CALL FUNCTION 'CS_BOM_EXPL_MAT_V2'
EXPORTING
CAPID = 'PP01'
DATUV = SY-DATUM
MEHRS = 'X' "BOM多层展开
MTNRV = IT_MAST-MATNR
MKTLS = 'X' "需要与MEHRS配合
* STLAN = '1' "BOM用途不能设置?1.5
WERKS = '1200'
* EMENG = '1' " 需求数量
* EHNDL = '1'
* MMORY = '1'
TABLES
STB = IT_BOM
EXCEPTIONS
ALT_NOT_FOUND = 1
CALL_INVALID = 2
MATERIAL_NOT_FOUND = 3
MISSING_AUTHORIZATION = 4
NO_BOM_FOUND = 5
NO_PLANT_DATA = 6
NO_SUITABLE_BOM_FOUND = 7
CONVERSION_ERROR = 8
OTHERS = 9
.
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
IF SY-SUBRC EQ 0.
LOOP AT IT_BOM.
* IT_ALV1-STUFE = IT_BOM-STUFE.
IT_ALV1-MATNR = IT_MAST-MATNR.
* IT_ALV1-CWERK = IT_MAST-CWERK.
IT_ALV1-MAKTX = IT_MAST-CMAKTX.
* IT_ALV1-WERKS = IT_BOM-WERKS.
IT_ALV1-IDNRK = IT_BOM-IDNRK.
IT_ALV1-MEINS = IT_BOM-MEINS.
IT_ALV1-OJTXP = IT_BOMS-OJTXP.
IT_ALV1-MATMK = IT_BOMS-MATMK.
* IT_ALV1-MNGLG = IT_BOM-MNGLG.
APPEND IT_ALV1.
ENDLOOP.
CLEAR:IT_BOM[]."MODIFY
ENDIF.
BOM展开函数 其中的参数设置还是有待研究
最新推荐文章于 2020-12-26 20:15:20 发布