on 07-14-2020 11:18 PM
I am looking for a master list of all raw materials used across all of the BOMs in my plant for organization purposes. What is the best way to go about this?
Hi,
try the function module given below
LOOP AT it_mast_t INTO wa_mast_t.
CALL FUNCTION 'CS_BOM_EXPL_MAT_V2'
EXPORTING
capid = 'PP01'
datuv = sy-datum
mktls = 'X'
mehrs = 'X'
mmory = '1'
mtnrv = wa_mast_t-matnr
werks = wa_mast_t-werks
TABLES
stb = it_stb2
matcat = it_matcat
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
OTHERS = 8.
IF it_stb2[] IS NOT INITIAL.
LOOP AT it_stb2 INTO wa_stb2.
CLEAR wa_mast_f.
MOVE-CORRESPONDING wa_stb2 TO wa_mast_f.
IF wa_mast_t-stlnr EQ wa_mast_f-stlnr.
MOVE : wa_mast_t-matnr TO wa_mast_f-matnr.
ENDIF.
APPEND wa_mast_f TO it_mast_f.
ENDLOOP.
ENDIF.
SORT it_mast_f.
ENDLOOP.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
110 | |
12 | |
11 | |
6 | |
5 | |
4 | |
4 | |
3 | |
3 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.