ZCMM01-35

MODULE CHECK_AUFNR INPUT.

  DATA: L_OBJECT LIKE AUFK-OBJNR.
  DATA: L_WO  LIKE AUFK-AUFNR.

  CALL FUNCTION 'CONVERSION_EXIT_AUFNR_INPUT'
       EXPORTING
            INPUT  = ZCM03-AUFNR
       IMPORTING
            UTPUT = L_WO.

  SELECT  SINGLE OBJNR INTO L_OBJECT
  FROM    AUFK
  WHERE  AUFNR = L_WO.
  IF ZCM03-DOCTYPE = 'K' OR ZCM03-DOCTYPE = 'L'.
    IF ZCM03-COMMENTTEXT IS INITIAL.
      MESSAGE E000 WITH 'SN# is initial!'.
      EXIT.
    ENDIF.
    SELECT  SINGLE VBAP~VBELN  VBAP~POSNR
                                 VBAP~WERKS
    INTO (L_KDAUF,L_KDPOS,T_WERKS)
    FROM VBAP INNER JOIN VBAK
    ON VBAP~VBELN = VBAK~VBELN
    WHERE VBAK~BSTNK = ZCM03-AUFNR
    AND VBAP~KANNR = ZCM03-COMMENTTEXT
    AND VBAP~PSTYV = 'ZIRS'.
    IF SY-SUBRC <> 0.
      MESSAGE E000 WITH 'RMA#/SN# is not exist!'.
      EXIT.
    ENDIF.

        SELECT SINGLE LGORT INTO T_LGORT FROM LIPS
        WHERE VGBEL   = L_KDAUF.


  ENDIF.
  IF ZCM03-DOCTYPE = '1' OR
     ZCM03-DOCTYPE = '2' OR
     ZCM03-DOCTYPE = '3' OR
     ZCM03-DOCTYPE = '13' OR
     ZCM03-DOCTYPE = '9'."LBG20080401.ADD
    SELECT SINGLE *
    FROM  JEST
    WHERE BJNR = L_OBJECT
    AND   STAT = 'I0002'  "Rel
    AND   INACT <> 'X'.
    IF SY-SUBRC <> 0.
      MESSAGE E000 WITH 'Order Status Error,Only REL Allow!'.
      EXIT.
    ELSE.
      CLEAR JEST.
      SELECT SINGLE *
      FROM  JEST
      WHERE BJNR = L_OBJECT
      AND   STAT ='I0076'.
      IF SY-SUBRC = 0 AND JEST-INACT <> 'X'.
        MESSAGE E000 WITH 'Order Has Been Delted!'.
        EXIT.
      ELSE.
        CLEAR JEST.
        SELECT SINGLE *
        FROM  JEST
        WHERE BJNR = L_OBJECT
        AND   STAT ='I0043'.
        IF SY-SUBRC = 0 AND JEST-INACT <> 'X'.
          MESSAGE E000 WITH 'Order Has Been LOCKED'.
          EXIT.
        ELSE.
          CLEAR JEST.
          SELECT SINGLE *
          FROM  JEST
          WHERE BJNR = L_OBJECT
          AND   STAT ='I0045'.
          IF SY-SUBRC = 0 AND JEST-INACT <> 'X'.
            MESSAGE E000 WITH 'Order Has Been TECO'.
            EXIT.
          ELSE.
            CLEAR JEST.
            SELECT SINGLE *
            FROM  JEST
            WHERE BJNR = L_OBJECT
            AND   STAT ='I0046'.
            IF SY-SUBRC = 0 AND JEST-INACT <> 'X'.
              MESSAGE E000 WITH 'Order Has Been CLOSED'.
              EXIT.
            ENDIF.
          ENDIF.
        ENDIF.
      ENDIF.
    ENDIF.
  ENDIF.

  CLEAR ORD_QTY.
  SELECT SINGLE PSMNG FROM AFPO INTO ORD_QTY
         WHERE AUFNR = L_WO.

ENDMODULE.                 " check_aufnr  INPUT
*---------------------------------------------JL071207.en
*&--------------------------------------------------------------

*&      Module  check_parameter  INPUT
*&--------------------------------------------------------------

*       text
*---------------------------------------------------------------

MODULE CHECK_PARAMETER INPUT.
  DATA:P_OBJECT LIKE ZMM048-OBJECT.
  CLEAR:P_OBJECT.

  SELECT *
  FROM ZCM20
  WHERE EMPLOYID = ZCM03-EMPLOYID.
    EXIT.
  ENDSELECT.
  IF SY-SUBRC = 0."Employid belong to 'PSY1'
    CONCATENATE 'AUTOPOST' ZCM03-DOCTYPE INTO P_OBJECT.
    SELECT SINGLE *
    FROM ZMM048
    WHERE WERKS = 'PSY1'
    AND BJECT = P_OBJECT
    AND VALUE = 'ACTIVE'.

    IF SY-SUBRC = 0.
      IF F_SHOW <> 'Y'.
        F_SHOW = 'Y'.
        LEAVE TO SCREEN 1000.
      ENDIF.
    ELSE.
      F_SHOW = 'N'.
    ENDIF.
  ELSE.
    F_SHOW = 'N'.
  ENDIF.
ENDMODULE.                 " check_parameter  INPUT
*&--------------------------------------------------------------

*&      Form  set_show
*&--------------------------------------------------------------

*       text
*---------------------------------------------------------------

*      --&gtP_0275   text
*---------------------------------------------------------------

FORM. SET_SHOW_1000 USING NUM1 NUM2.

  LOOP AT SCREEN.
    IF SCREEN-GROUP1 = 'TCR'.
      SCREEN-INVISIBLE = NUM2.
    ENDIF.
    IF SCREEN-GROUP1 = 'CR'.
      SCREEN-ACTIVE = NUM1.
    ENDIF.
*mark by yuan-yuan xiao 080714
*    if screen-group1 = 'TP1'.
*      screen-invisible = num2.
*    endif.
*    if screen-group1 = 'P1'.
*      screen-active = num1.
*    endif.
*
    MODIFY SCREEN.
  ENDLOOP.
ENDFORM.                    " set_show

来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/14397246/viewspace-666186/,如需转载,请注明出处,否则将追究法律责任。

转载于:http://blog.itpub.net/14397246/viewspace-666186/

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值