There are many related multi-layer extended BOM functions. The following lists the three most commonly used BOM extended functions and two document structure extended functions.
Of course, there are other related functions that start with cs_bom.
Pay attention to this attribute mehrs when using it. If mehrs = 'x', it will be extended in multiple layers. Otherwise, only the current BOM will be opened.
Data: STB type standard table of stpox with header line.
Data: matcat type standard table of cscmat with header line.
P_mat type rc29l-matnr obligatory, item No.
P_wer type rc29l-werks default '200', "Factory
P_stl type rc29l-stlal, "selectable BOM
P_cap type rc29l-capid obligatory, "Bom application pp01 zdes
P_dat type rc29l-datuv default sy-datum. "Date
"Extended item bom1
Call function 'cs _ bom_expl_mat_v2'
Exporting
Capid = p_cap
Datuv = p_dat
Mehrs = 'X'
Mtnrv = p_mat
Stlal = p_stl
Werks = p_wer
Importing
Topmat = topmat
Tables
STB = STB "detail list
Matcat = matcat "Bom list
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.
Endif.
"Extended item bom2
Data: stbp type standard table of csxgen with header line.
Call function 'cs _ bom_explosion'
Exporting
Capid = p_cap
Datuv = p_dat
Mehrs = 'X'
Mtnrv = p_mat
Stlal = p_stl
Werks = p_wer
Importing
Topmat = topmat
Tables
STB = STB "detail list
Matcat = matcat "Bom list
Exceptions
Alt_not_found = 1
Call_invalid = 2
Missing_authorization = 3
No_bom_found = 4
No_plant_data = 5
No_suitable_bom_found = 6
Object_not_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.
Endif.
"Extended item bom3
Data: STB type standard table of stpol with header line.
Call function 'cs _ bom_explosion'
Exporting
Capid = p_cap
Datuv = p_dat
Mehrs = 'X'
Mtnrv = p_mat
Stlal = p_stl
Werks = p_wer
Importing
Topmat = topmat
Tables
STB = STB "detail list
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 sy-subrc <> 0.
* Message ID SY-MSGID type SY-MSGTY number SY-MSGNO
* With SY-MSGV1 SY-MSGV2 SY-MSGV3.
Endif.
"Extended Document structure 1
Call function 'cs _ bom_expl_doc_v1'
Exporting
Datuv = sy-Datum
Docnr = Document No.
Docar = Type
Doctl = part
Docvr = version
Importing
Topdoc = returns the document information in the document structure header.
Tables
STB = return detailed list
Doccat = List of returned document structures (several document structures are available)
Exceptions
Call_invalid = 1
Document_not_found = 2
Missing_authorization = 3
No_bom_found = 4
No_suitable_bom_found = 5
Bom_not_active = 6
Bom_flagged_for_deletion = 7
Bom_without_positions = 8
Others = 9
.
If sy-subrc <> 0.
* Message ID SY-MSGID type SY-MSGTY number SY-MSGNO
* With SY-MSGV1 SY-MSGV2 SY-MSGV3.
Endif.
"Extended Document structure 2
Call function 'cs _ bom_expl_gnrl2_v1'
Exporting
Datuv = sy-Datum
Docnr = Document No.
Docar = Type
Doctl = part
Docvr = version
Mehrs = 'X'
Importing
Topdoc =
Tables
Stbd =
Stbp =
Exceptions
Call_invalid = 1
Object_not_found = 2
Missing_authorization = 3
No_bom_found = 4
No_suitable_bom_found = 5
Bom_not_active = 6
Bom_flagged_for_deletion = 7
Bom_without_positions = 8
Others = 9
.
If sy-subrc <> 0.
* Message ID SY-MSGID type SY-MSGTY number SY-MSGNO
* With SY-MSGV1 SY-MSGV2 SY-MSGV3.
Endif.