SAP CSAP_MAT_BOM_READ Function Module for APIs for BOMs: Display Material BOM
CSAP_MAT_BOM_READ is a standard csap mat bom read SAP function module available within SAP R/3 or S/4 Hana systems, depending on your version and release level. It is used for APIs for BOMs: Display Material BOM processing and below is the pattern details for this FM, showing its interface including any import and export parameters, exceptions etc. there is also a full "cut and paste" ABAP pattern code example, along with implementation ABAP coding, documentation and contribution comments specific to this or related objects.
See here to view full function module documentation and code listing for csap mat bom read FM, simply by entering the name CSAP_MAT_BOM_READ into the relevant SAP transaction such as SE37 or SE38.
Function Group: CSAP
Program Name: SAPLCSAP
Main Program: SAPLCSAP
Appliation area: C
Release date: N/A
Mode(Normal, Remote etc): Remote-Enabled
Update:

Function CSAP_MAT_BOM_READ pattern details
In-order to call this FM within your sap programs, simply using the below ABAP pattern details to trigger the function call...or see the full ABAP code listing at the end of this article. You can simply cut and paste this code into your ABAP progrom as it is, including variable declarations.CALL FUNCTION 'CSAP_MAT_BOM_READ'"APIs for BOMs: Display Material BOM.
EXPORTING
MATERIAL = "Material
* FL_DMU_TMX = "Flag: Read DMU Transformation Matrices
* PLANT = "Plant
BOM_USAGE = "BOM usage
* ALTERNATIVE = "Alternative BOM
* VALID_FROM = "Valid-from date
* VALID_TO = "Valid-to date
* CHANGE_NO = "Change number
* REVISION_LEVEL = "Revision level
* FL_DOC_LINKS = "Flag: Read Document Assignments
IMPORTING
FL_WARNING = "Log contains warning messages
TABLES
* T_STPO = "BOM items
* T_LTX_LINE = "BOMs: Long Texts
* T_STPU = "API Structure for Internal APIs: STPU and Identifier
* T_STKO = "BOM headers
* T_DEP_DATA = "Object dependencies: basic data
* T_DEP_DESCR = "Object dependencies: description
* T_DEP_ORDER = "Object dependencies: sort sequence
* T_DEP_SOURCE = "Object dependencies: source code
* T_DEP_DOC = "Object dependencies: documentation
* T_DOC_LINK = "Document Assignments
* T_DMU_TMX = "DMU Transformation Matrices
EXCEPTIONS
ERROR = 1
IMPORTING Parameters details for CSAP_MAT_BOM_READ
MATERIAL - Material
Data type: CSAP_MBOM-MATNROptional: No
Call by Reference: No ( called with pass by value option)
FL_DMU_TMX - Flag: Read DMU Transformation Matrices
Data type: CSDATA-XFELDOptional: Yes
Call by Reference: No ( called with pass by value option)
PLANT - Plant
Data type: CSAP_MBOM-WERKSOptional: Yes
Call by Reference: No ( called with pass by value option)
BOM_USAGE - BOM usage
Data type: CSAP_MBOM-STLANOptional: No
Call by Reference: No ( called with pass by value option)
ALTERNATIVE - Alternative BOM
Data type: CSAP_MBOM-STLALOptional: Yes
Call by Reference: No ( called with pass by value option)
VALID_FROM - Valid-from date
Data type: CSAP_MBOM-DATUVOptional: Yes
Call by Reference: No ( called with pass by value option)
VALID_TO - Valid-to date
Data type: CSAP_MBOM-DATUBOptional: Yes
Call by Reference: No ( called with pass by value option)
CHANGE_NO - Change number
Data type: CSAP_MBOM-AENNROptional: Yes
Call by Reference: No ( called with pass by value option)
REVISION_LEVEL - Revision level
Data type: CSAP_MBOM-REVLVOptional: Yes
Call by Reference: No ( called with pass by value option)
FL_DOC_LINKS - Flag: Read Document Assignments
Data type: CSDATA-XFELDOptional: Yes
Call by Reference: No ( called with pass by value option)
EXPORTING Parameters details for CSAP_MAT_BOM_READ
FL_WARNING - Log contains warning messages
Data type: CAPIFLAG-FLWARNINGOptional: No
Call by Reference: No ( called with pass by value option)
TABLES Parameters details for CSAP_MAT_BOM_READ
T_STPO - BOM items
Data type: STPO_API02Optional: Yes
Call by Reference: No ( called with pass by value option)
T_LTX_LINE - BOMs: Long Texts
Data type: CSLTX_LINEOptional: Yes
Call by Reference: Yes
T_STPU - API Structure for Internal APIs: STPU and Identifier
Data type: STPU_API01Optional: Yes
Call by Reference: Yes
T_STKO - BOM headers
Data type: STKO_API02Optional: Yes
Call by Reference: No ( called with pass by value option)
T_DEP_DATA - Object dependencies: basic data
Data type: CSDEP_DATOptional: Yes
Call by Reference: No ( called with pass by value option)
T_DEP_DESCR - Object dependencies: description
Data type: CSDEP_DESCOptional: Yes
Call by Reference: No ( called with pass by value option)
T_DEP_ORDER - Object dependencies: sort sequence
Data type: CSDEP_ORDOptional: Yes
Call by Reference: No ( called with pass by value option)
T_DEP_SOURCE - Object dependencies: source code
Data type: CSDEP_SORCOptional: Yes
Call by Reference: No ( called with pass by value option)
T_DEP_DOC - Object dependencies: documentation
Data type: CSDEP_DOCOptional: Yes
Call by Reference: No ( called with pass by value option)
T_DOC_LINK - Document Assignments
Data type: CSDOC_LINKOptional: Yes
Call by Reference: Yes
T_DMU_TMX - DMU Transformation Matrices
Data type: CSDMU_TMXOptional: Yes
Call by Reference: Yes
EXCEPTIONS details
ERROR - Terminate processing
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
Copy and paste ABAP code example for CSAP_MAT_BOM_READ Function Module
The ABAP code below is a full code listing to execute function module POPUP_TO_CONFIRM including all data declarations. The code uses the original data declarations rather than the latest in-line data DECLARATION SYNTAX but I have included an ABAP code snippet at the end to show how declarations would look using the newer method of declaring data variables on the fly. This will allow you to compare and fully understand the new inline method. Please note some of the newer syntax such as the @DATA is not available until a later 4.70 service pack (SP8), which i why i have stuck to the origianl for this example.| DATA: | ||||
| lv_error | TYPE STRING, " | |||
| lt_t_stpo | TYPE STANDARD TABLE OF STPO_API02, " | |||
| lv_material | TYPE CSAP_MBOM-MATNR, " | |||
| lv_fl_warning | TYPE CAPIFLAG-FLWARNING, " | |||
| lv_fl_dmu_tmx | TYPE CSDATA-XFELD, " | |||
| lt_t_ltx_line | TYPE STANDARD TABLE OF CSLTX_LINE, " | |||
| lt_t_stpu | TYPE STANDARD TABLE OF STPU_API01, " | |||
| lv_plant | TYPE CSAP_MBOM-WERKS, " | |||
| lt_t_stko | TYPE STANDARD TABLE OF STKO_API02, " | |||
| lv_bom_usage | TYPE CSAP_MBOM-STLAN, " | |||
| lt_t_dep_data | TYPE STANDARD TABLE OF CSDEP_DAT, " | |||
| lv_alternative | TYPE CSAP_MBOM-STLAL, " | |||
| lt_t_dep_descr | TYPE STANDARD TABLE OF CSDEP_DESC, " | |||
| lv_valid_from | TYPE CSAP_MBOM-DATUV, " | |||
| lt_t_dep_order | TYPE STANDARD TABLE OF CSDEP_ORD, " | |||
| lv_valid_to | TYPE CSAP_MBOM-DATUB, " | |||
| lt_t_dep_source | TYPE STANDARD TABLE OF CSDEP_SORC, " | |||
| lv_change_no | TYPE CSAP_MBOM-AENNR, " | |||
| lt_t_dep_doc | TYPE STANDARD TABLE OF CSDEP_DOC, " | |||
| lt_t_doc_link | TYPE STANDARD TABLE OF CSDOC_LINK, " | |||
| lv_revision_level | TYPE CSAP_MBOM-REVLV, " | |||
| lt_t_dmu_tmx | TYPE STANDARD TABLE OF CSDMU_TMX, " | |||
| lv_fl_doc_links | TYPE CSDATA-XFELD. " |
|   CALL FUNCTION 'CSAP_MAT_BOM_READ' "APIs for BOMs: Display Material BOM |
| EXPORTING | ||
| MATERIAL | = lv_material | |
| FL_DMU_TMX | = lv_fl_dmu_tmx | |
| PLANT | = lv_plant | |
| BOM_USAGE | = lv_bom_usage | |
| ALTERNATIVE | = lv_alternative | |
| VALID_FROM | = lv_valid_from | |
| VALID_TO | = lv_valid_to | |
| CHANGE_NO | = lv_change_no | |
| REVISION_LEVEL | = lv_revision_level | |
| FL_DOC_LINKS | = lv_fl_doc_links | |
| IMPORTING | ||
| FL_WARNING | = lv_fl_warning | |
| TABLES | ||
| T_STPO | = lt_t_stpo | |
| T_LTX_LINE | = lt_t_ltx_line | |
| T_STPU | = lt_t_stpu | |
| T_STKO | = lt_t_stko | |
| T_DEP_DATA | = lt_t_dep_data | |
| T_DEP_DESCR | = lt_t_dep_descr | |
| T_DEP_ORDER | = lt_t_dep_order | |
| T_DEP_SOURCE | = lt_t_dep_source | |
| T_DEP_DOC | = lt_t_dep_doc | |
| T_DOC_LINK | = lt_t_doc_link | |
| T_DMU_TMX | = lt_t_dmu_tmx | |
| EXCEPTIONS | ||
| ERROR = 1 | ||
| . " CSAP_MAT_BOM_READ | ||
ABAP code using 7.40 inline data declarations to call FM CSAP_MAT_BOM_READ
The below ABAP code uses the newer in-line data declarations. This allows you to see the coding differences/benefits of the later inline syntax. Please note some of the newer syntax below, such as the @DATA is not available until 4.70 EHP 8.| "SELECT single MATNR FROM CSAP_MBOM INTO @DATA(ld_material). | ||||
| "SELECT single FLWARNING FROM CAPIFLAG INTO @DATA(ld_fl_warning). | ||||
| "SELECT single XFELD FROM CSDATA INTO @DATA(ld_fl_dmu_tmx). | ||||
| "SELECT single WERKS FROM CSAP_MBOM INTO @DATA(ld_plant). | ||||
| "SELECT single STLAN FROM CSAP_MBOM INTO @DATA(ld_bom_usage). | ||||
| "SELECT single STLAL FROM CSAP_MBOM INTO @DATA(ld_alternative). | ||||
| "SELECT single DATUV FROM CSAP_MBOM INTO @DATA(ld_valid_from). | ||||
| "SELECT single DATUB FROM CSAP_MBOM INTO @DATA(ld_valid_to). | ||||
| "SELECT single AENNR FROM CSAP_MBOM INTO @DATA(ld_change_no). | ||||
| "SELECT single REVLV FROM CSAP_MBOM INTO @DATA(ld_revision_level). | ||||
| "SELECT single XFELD FROM CSDATA INTO @DATA(ld_fl_doc_links). | ||||
Search for further information about these or an SAP related objects