SAP BOM批量反查成品BOM清单(带BOM组件数量,反查物料清单)

1. BOM批量反查成品BOM清单(带BOM组件数量,反查物料清单)

  • 代码执行的效果
    SAP BOM批量反查成品BOM清单(带BOM组件数量,反查物料清单)_第1张图片

  • 代码

    TABLES    :STAS,MARA,MAKT,MARC,T179T.
    TYPE-POOLS:SLIS.
    
    TYPES:BEGIN OF TY_1,
            VWALT(2)   TYPE C,
            MATNR      TYPE MARC-MATNR,
            MENGE      TYPE P DECIMALS 0,
            ZTEXT(255) TYPE C,
          END OF TY_1,
    
          BEGIN OF TY_2,
            MATNR      TYPE STPOV-MATNR,
            VWALT(2)   TYPE C,
            PMATNR     TYPE STPOV-MATNR,
            MAKTX      TYPE STPOV-OJTXB,
            MAKTX1     TYPE STPOV-OJTXB,
            MENGE      TYPE P DECIMALS 0,
            VTEXT      TYPE T179T-VTEXT,
            ZTEXT(255) TYPE C,
          END OF TY_2.
    
    DATA:WA_STORE   TYPE TY_2,
         WA_GATHER  TYPE  TY_1,
         WA_STPOV   TYPE STPOV,
         WA_GATHER2 TYPE TY_1.
    
    
    DATA:IT_STORE   TYPE TABLE OF TY_2,
         IT_GATHER  TYPE TABLE OF TY_1,
         IT_GATHER2 TYPE TABLE OF TY_1,
         IT_LIST    TYPE TABLE OF STPOV,
         IT_EQUICAT TYPE TABLE OF CSCEQUI,
         IT_KNDCAT  TYPE TABLE OF CSCKND,
         IT_MATCAT  TYPE TABLE OF CSCMAT,
         IT_STDCAT  TYPE TABLE OF CSCSTD,
         IT_TPLCAT  TYPE TABLE OF CSCTPL.
    
    DATA:G_PARTNO TYPE MARC-MATNR.
    DATA:G_LANG   TYPE SY-LANGU.
    DATA:G_INDEX  TYPE SY-TABIX.
    DATA:G_CNT    TYPE SY-TFILL.
    DATA:G_REPID  TYPE SY-REPID.
    DATA:G_ABAPTRUE(1) TYPE C VALUE 'X',
         G_INIT(40)    TYPE C.
    
    
    DATA:WK_LAYOUT   TYPE SLIS_LAYOUT_ALV,
         WA_DIELDCAT TYPE SLIS_FIELDCAT_ALV,
         LT_FIELDCAT TYPE TABLE OF SLIS_FIELDCAT_ALV.
    
    
    SELECT-OPTIONS:S_MATNR FOR MARC-MATNR NO INTERVALS OBLIGATORY.
    PARAMETERS:P_WERKS  TYPE MARC-WERKS OBLIGATORY,
               P_VALDAT TYPE SY-DATUM DEFAULT SY-DATUM.
    
    DEFINE ALV_SPEC.
      WA_DIELDCAT-FIELDNAME = &1.
      WA_DIELDCAT-SELTEXT_M = &2.
      WA_DIELDCAT-TABNAME = 'IT_STORE'.
      CASE &1.
      WHEN 'VWALT'.
        WA_DIELDCAT-NO_ZERO = G_ABAPTRUE.
      WHEN 

你可能感兴趣的:(ABAP开发,ABAP,实用程序记录,ABAP,BOM)