CSAP_MAT_BOM_CREATE is a standard SAP function module available within R/3 SAP systems depending on your version and release level. Below is the pattern details for this FM showing its interface including any import and export parameters, exceptions etc as well as any documentation contributions (Comments) specific to the object.
See here to view full function module documentation and code listing, simply by entering the name CSAP_MAT_BOM_CREATE into the relevant SAP transaction such as SE37 or SE80.
Associated Function Group:
CSAP
Released Date:
Not Released
Processing type: Remote-Enabled
CALL FUNCTION 'CSAP_MAT_BOM_CREATE' "
EXPORTING
material = " csap_mbom-matnr Material
* plant = " csap_mbom-werks Plant
bom_usage = " csap_mbom-stlan BOM usage
* valid_from = " csap_mbom-datuv Valid-from date
* change_no = " csap_mbom-aennr Change number
* revision_level = " csap_mbom-revlv Revision level
i_stko = " stko_api01 BOM header data
* fl_no_change_doc = SPACE " capiflag-no_chg_doc Do not write change documents
* fl_commit_and_wait = SPACE " capiflag-comm_wait
* fl_cad = SPACE " csdata-char1
* fl_default_values = 'X' " csdata-xfeld Default Values for New Items
IMPORTING
fl_warning = " capiflag-flwarning Log contains warning messages
bom_no = " stko_api02-bom_no
* TABLES
* t_stpo = " stpo_api01 BOM items
* t_dep_data = " csdep_dat Object dependencies: basic data
* t_dep_descr = " csdep_desc Object dependencies: description
* t_dep_order = " csdep_ord Object dependencies: sort sequence
* t_dep_source = " csdep_sorc Object dependencies: source code
* t_dep_doc = " csdep_doc Object dependencies: documentation
* t_ltx_line = " csltx_line
* t_stpu = " stpu_api01 BOM sub-items
EXCEPTIONS
ERROR = 1 " Terminate processing
. " CSAP_MAT_BOM_CREATE
The ABAP code below is a full code listing to execute function module CSAP_MAT_BOM_CREATE including all data declarations. The code uses 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 original method of declaring data variables up front. 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).
| ld_fl_warning | TYPE CAPIFLAG-FLWARNING , |
| ld_bom_no | TYPE STKO_API02-BOM_NO , |
| it_t_stpo | TYPE STANDARD TABLE OF STPO_API01,"TABLES PARAM |
| wa_t_stpo | LIKE LINE OF it_t_stpo , |
| it_t_dep_data | TYPE STANDARD TABLE OF CSDEP_DAT,"TABLES PARAM |
| wa_t_dep_data | LIKE LINE OF it_t_dep_data , |
| it_t_dep_descr | TYPE STANDARD TABLE OF CSDEP_DESC,"TABLES PARAM |
| wa_t_dep_descr | LIKE LINE OF it_t_dep_descr , |
| it_t_dep_order | TYPE STANDARD TABLE OF CSDEP_ORD,"TABLES PARAM |
| wa_t_dep_order | LIKE LINE OF it_t_dep_order , |
| it_t_dep_source | TYPE STANDARD TABLE OF CSDEP_SORC,"TABLES PARAM |
| wa_t_dep_source | LIKE LINE OF it_t_dep_source , |
| it_t_dep_doc | TYPE STANDARD TABLE OF CSDEP_DOC,"TABLES PARAM |
| wa_t_dep_doc | LIKE LINE OF it_t_dep_doc , |
| it_t_ltx_line | TYPE STANDARD TABLE OF CSLTX_LINE,"TABLES PARAM |
| wa_t_ltx_line | LIKE LINE OF it_t_ltx_line , |
| it_t_stpu | TYPE STANDARD TABLE OF STPU_API01,"TABLES PARAM |
| wa_t_stpu | LIKE LINE OF it_t_stpu . |
The below ABAP code uses the older none in-line data declarations. This allows you to see the coding differences/benefits of the later inline syntax. It may also be useful if you are using an older version of SAP as some of the newer syntax above, such as the @DATA is not available until 4.70 EHP 8.
DATA:
| ld_fl_warning | TYPE CAPIFLAG-FLWARNING , |
| ld_material | TYPE CSAP_MBOM-MATNR , |
| it_t_stpo | TYPE STANDARD TABLE OF STPO_API01 , |
| wa_t_stpo | LIKE LINE OF it_t_stpo, |
| ld_bom_no | TYPE STKO_API02-BOM_NO , |
| ld_plant | TYPE CSAP_MBOM-WERKS , |
| it_t_dep_data | TYPE STANDARD TABLE OF CSDEP_DAT , |
| wa_t_dep_data | LIKE LINE OF it_t_dep_data, |
| ld_bom_usage | TYPE CSAP_MBOM-STLAN , |
| it_t_dep_descr | TYPE STANDARD TABLE OF CSDEP_DESC , |
| wa_t_dep_descr | LIKE LINE OF it_t_dep_descr, |
| ld_valid_from | TYPE CSAP_MBOM-DATUV , |
| it_t_dep_order | TYPE STANDARD TABLE OF CSDEP_ORD , |
| wa_t_dep_order | LIKE LINE OF it_t_dep_order, |
| ld_change_no | TYPE CSAP_MBOM-AENNR , |
| it_t_dep_source | TYPE STANDARD TABLE OF CSDEP_SORC , |
| wa_t_dep_source | LIKE LINE OF it_t_dep_source, |
| ld_revision_level | TYPE CSAP_MBOM-REVLV , |
| it_t_dep_doc | TYPE STANDARD TABLE OF CSDEP_DOC , |
| wa_t_dep_doc | LIKE LINE OF it_t_dep_doc, |
| ld_i_stko | TYPE STKO_API01 , |
| it_t_ltx_line | TYPE STANDARD TABLE OF CSLTX_LINE , |
| wa_t_ltx_line | LIKE LINE OF it_t_ltx_line, |
| ld_fl_no_change_doc | TYPE CAPIFLAG-NO_CHG_DOC , |
| it_t_stpu | TYPE STANDARD TABLE OF STPU_API01 , |
| wa_t_stpu | LIKE LINE OF it_t_stpu, |
| ld_fl_commit_and_wait | TYPE CAPIFLAG-COMM_WAIT , |
| ld_fl_cad | TYPE CSDATA-CHAR1 , |
| ld_fl_default_values | TYPE CSDATA-XFELD . |
You can use this function module to create simple material BOMs.
You cannot add alternatives or variants to a BOM, as in transaction...See here for full SAP fm documentati
Please help keep this info upto date and use the comments section below to add useful hints, tips and information specific to this SAP function. This will then be available for you and other users to easily find by simply searching on the object name CSAP_MAT_BOM_CREATE or its description.