1. Check BOM
Call FUNCTION ' Cs_bom_expl_mat_v2 '
Exporting
Capid = pm_capid "application is generally PP01
DATUV = Pm_datuv "is usually the current date of the system
MTNRV = PM_MTNRV "item to expand BOM
mehrs = ' x ' x indicates a multilayer expansion,space means only the first layer is expanded
Werks = Pm_werks "is typically 1000
Importing
Topmat = Selpool
DSTST = DSTST_FLG
TABLES
STB = STB "The expanded BOM is stored in the inner table
Matcat = Matcat "The material containing the component below is stored in the inner table
2. Inverse Check BOM
DATA:IT_WULTB like Stpov occurs 0 with HEADER line,
It_equicat like Cscequi occurs 0 with HEADER line,
It_kndcat like cscknd occurs 0 with HEADER line,
It_matcat like Cscmat occurs 0 with HEADER line,
It_stdcat like cscstd occurs 0 with HEADER line,
It_tplcat like CSCTPL occurs 0 with HEADER line,
It_prjcat like cscprj occurs 0 with HEADER line.
Clear:it_wultb,it_wultb[].
Call FUNCTION ' Cs_where_used_mat '
Exporting
Datub = Sy-datum
DATUV = Sy-datum
MATNR = P_c_matnr
* POSTP = "
* Retcode_only = "
* Stlan = "
MCLMT = ' 00000000 '
Werks = S2_werks
* Importing
* Topmat =
TABLES
WULTB = IT_WULTB
Equicat = It_equicat
Kndcat = It_kndcat
Matcat = It_matcat
Stdcat = It_stdcat
Tplcat = It_tplcat
EXCEPTIONS
Call_invalid = 1
Material_not_found = 2
No_where_used_rec_found = 3
no_where_used_rec_selected = 4
No_where_used_rec_valid = 5
OTHERS = 6.
Copyright NOTICE: This article for Bo Master original article, without Bo Master permission not reproduced.
cis-Check BOM (expand BOM, CS12) and inverse check BOM (check upper material, CS15)