Bom expand CS_BOM_EXPL_MAT_V2
FUNCTION ZRFC_BOM_EXPL. * "required *" * "Local interface: *" IMPORTING * "VALUE (I _WERKS) TYPE WERKS_D OPTIONAL *" VALUE (I _MATNR) type matnr optional * "VALUE (I _DATUM) type datum default SY-DATUM * "TABLES *" output structure ZRFC_BOM_EXPL OPTIONAL * "additional DATA: GIT_STPOX like stpox occurs 0 with header line. DATA: GIT_CSCMAT like cscmat occurs 0 with header line. call function 'cs _ BOM_EXPL_MAT_V2 'EXPORTINGCAPID = 'pp01' "BOM type, such as production BOM, R & d bom, sales BOM and so on DATUV = SY-DATUM" fill in the date, the function filters out the valid component EHNDL = '1' EMENG = 1000 "sets the usage Unit * MEHRS = 'x'". A value indicates that multiple layers are expanded, similar to the things code CS12MTNRV = I _MATNR "BOM item STLAN = '1'" similar to the CAPID parameter, the expanded BOM is limited by the nature of WERKS = I _WERKS "TABLESSTB = GIT_STPOX" MATCAT = GIT_CSCMAT. "loop at GIT_STPOX.OUTPUT-MATKL = GIT_STPOX-MATKL.OUTPUT-IDNRK = GIT_STPOX-IDNRK.IF GIT_STPOX-IDNRK <> ''. OUTPUT-DOBJT = GIT_STPOX-IDNRK.ELSE.OUTPUT-DOBJT = GIT_STPOX-POTX1.ENDIF.OUTPUT-OJTXP = GIT_STPOX-OJTXP.OUTPUT-MNGKO = GIT_STPOX-MENGE.OUTPUT-MEINS = GIT_STPOX-MEINS.APPEND OUTPUT. clear output. ENDLOOP. ENDFUNCTION.