ITPub博客

首页 > Linux操作系统 > Linux操作系统 > Enhancement for ZXCO1U01

Enhancement for ZXCO1U01

原创 Linux操作系统 作者:ytfsrs2008 时间:2009-04-03 02:57:59 0 删除 编辑
Enhancement: PPCO0001
ZXCO1U01

DATA TEMP_BATCH LIKE MCHA-CHARG.
DATA TEMP_REVERSION LIKE AEOI-REVLV.
DATA L_OBJECT01 LIKE ZMM048-OBJECT.
DATA: L_MESTYE1(01) TYPE C.
CASE SY-MANDT.
  WHEN '100'.
*****  check W/O header material reversion   *******
    SELECT SINGLE OBJECT INTO L_OBJECT01
    FROM ZMM048
    WHERE WERKS = POSITION_TABLE-DWERK AND BJECT = 'WOBACTHCHK'
    AND VALUE = 'ACTIVE'.
    IF SY-SUBRC = 0.
      CLEAR: TEMP_BATCH,TEMP_REVERSION.

      IF ( SY-TCODE = 'CO02' OR SY-TCODE = 'CO01' OR SY-TCODE = 'CO08'
           OR SY-TCODE = 'CO41' OR SY-TCODE = 'CO40')
         AND POSITION_TABLE-MATNR <> ''.
        IF POSITION_TABLE-CHARG IS INITIAL .
          MESSAGE ID '00' TYPE 'A' NUMBER '208'
                  WITH 'Please Input W/O Header Batch!' .
        ELSEIF POSITION_TABLE-CHARG <> ''.
*      check batch
          SELECT SINGLE CHARG INTO TEMP_BATCH FROM MCHA
                   WHERE CHARG = POSITION_TABLE-CHARG
                        AND WERKS = HEADER_TABLE-WERKS
                        AND MATNR = POSITION_TABLE-MATNR.
          IF SY-SUBRC <> 0.
            MESSAGE ID '00' TYPE 'A' NUMBER '208'
                  WITH 'No Batch Master,please request for MDC!'.
          ENDIF.
*        check reversion
          SELECT SINGLE REVLV
           FROM AEOI INNER JOIN AENR ON AEOI~AENNR = AENR~AENNR
           INTO TEMP_REVERSION
           WHERE BJKT = POSITION_TABLE-MATNR
           AND REVLV = POSITION_TABLE-CHARG
           AND   AETYP = '41'
           AND   REVLV <> ''.
          IF SY-SUBRC <> 0.
            MESSAGE ID '00' TYPE 'A' NUMBER '208'
                  WITH 'No Reversion,please request for MDC!'.
          ENDIF.

******************Check Batch = Revision ?
          IF HEADER_TABLE-REVLV  <> TEMP_BATCH .
            IF SY-UNAME EQ 'PM' OR SY-UNAME CS 'CO'
              OR SY-UNAME CS 'CM'.

              L_MESTYE1 = 'W'.
            ELSE.
              L_MESTYE1 = 'A'.
            ENDIF.

            MESSAGE ID '00' TYPE L_MESTYE1 NUMBER '208'
                  WITH 'Revision and Batch does not match! Call help
                        FROM IT OR CM'.
          ENDIF.
        ENDIF.
      ENDIF.

*****  check W/O Detail material reversion   *******
      IF ( SY-TCODE = 'CO02' OR SY-TCODE = 'CO01' OR SY-TCODE = 'CO08'
            OR SY-TCODE = 'CO41' OR SY-TCODE = 'CO40').
        LOOP AT COMPONENT_TABLE.
          IF COMPONENT_TABLE-DUMPS <> 'X'  "phatom item
          AND COMPONENT_TABLE-SCHGT <> 'X'  "Bulk material
          AND COMPONENT_TABLE-CHARG IS INITIAL.

            MESSAGE ID '00' TYPE 'A' NUMBER '208'
                    WITH 'Please Input W/O component Batch!' .
            EXIT.
          ENDIF.
        ENDLOOP.

      ENDIF.
    ENDIF.

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

请登录后发表评论 登录
全部评论

注册时间:2008-10-31

  • 博文量
    52
  • 访问量
    50791