SAP Tables

CSAP_MAT_BOM_MAINTAIN SAP Function module




CSAP_MAT_BOM_MAINTAINis a standard SAP function module available within R/3 SAPsystems depending on your version and release level. Below is the pattern details for this FM showing its interface including any import/export parameters, exceptions etc as well as any documentation contributions specific to the object. See here to view full function module documentation and code listing, simply by entering the name CSAP_MAT_BOM_MAINTAIN into the relevant SAP transaction such as SE37 or SE80.

Contribute (Add Comments)
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_MAINTAIN or its description.


Pattern for FM CSAP_MAT_BOM_MAINTAIN - CSAP MAT BOM MAINTAIN
Associated Function Group: CSAP
Released Date: Not Released
CALL FUNCTION 'CSAP_MAT_BOM_MAINTAIN' "
  EXPORTING
    material =                  " csap_mbom-matnr  Material
*   plant =                     " csap_mbom-werks  Plant
    bom_usage =                 " csap_mbom-stlan  BOM usage
*   alternative =               " csap_mbom-stlal  Alternative BOM
*   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_bom_create = SPACE       " csdata-xfeld  Create BOM if it does not exist
*   fl_new_item = SPACE         " csdata-xfeld  Create item if it does not exist
*   fl_default_values = 'X'     " csdata-xfeld  Default Values for New Items
  IMPORTING
    fl_warning =                " capiflag-flwarning  Log contains warning messages
    o_stko =                    " stko_api02    BOM header data
* TABLES
*   t_stpo =                    " stpo_api03    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_stpu =                    " stpu_api01    BOM sub-items
  EXCEPTIONS
    ERROR = 1                   "               Terminate processing
    .  "  CSAP_MAT_BOM_MAINTAIN

ABAP code example for Function Module CSAP_MAT_BOM_MAINTAIN

The ABAP code below is a full code listing to execute function module CSAP_MAT_BOM_MAINTAIN including all data declarations. The code uses the latest in-line data declaration syntax but I have included an abap code snipet 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).
DATA:
ld_fl_warning   TYPE CAPIFLAG-FLWARNING,
ld_o_stko   TYPE STKO_API02,
it_t_stpo   TYPE STANDARD TABLE OF STPO_API03,"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_stpu   TYPE STANDARD TABLE OF STPU_API01,"tables param
wa_t_stpu LIKE LINE OF it_t_stpu  .


DATA(ld_material). = 'some text here'

DATA(ld_plant). = 'some text here'

DATA(ld_bom_usage). = 'some text here'

DATA(ld_alternative). = 'some text here'

DATA(ld_valid_from). = 'some text here'

DATA(ld_change_no). = 'some text here'

DATA(ld_revision_level). = 'some text here'
DATA(ld_i_stko) = 'Check type of data required'.

DATA(ld_fl_no_change_doc). = 'some text here'

DATA(ld_fl_bom_create). = 'some text here'

DATA(ld_fl_new_item). = 'some text here'

DATA(ld_fl_default_values). = 'some text here'

"populate fields of struture and append to itab
append wa_t_stpo to it_t_stpo.

"populate fields of struture and append to itab
append wa_t_dep_data to it_t_dep_data.

"populate fields of struture and append to itab
append wa_t_dep_descr to it_t_dep_descr.

"populate fields of struture and append to itab
append wa_t_dep_order to it_t_dep_order.

"populate fields of struture and append to itab
append wa_t_dep_source to it_t_dep_source.

"populate fields of struture and append to itab
append wa_t_dep_doc to it_t_dep_doc.

"populate fields of struture and append to itab
append wa_t_stpu to it_t_stpu.. CALL FUNCTION 'CSAP_MAT_BOM_MAINTAIN' EXPORTING material = ld_material * plant = ld_plant bom_usage = ld_bom_usage * alternative = ld_alternative * valid_from = ld_valid_from * change_no = ld_change_no * revision_level = ld_revision_level i_stko = ld_i_stko * fl_no_change_doc = ld_fl_no_change_doc * fl_bom_create = ld_fl_bom_create * fl_new_item = ld_fl_new_item * fl_default_values = ld_fl_default_values IMPORTING fl_warning = ld_fl_warning o_stko = ld_o_stko * TABLES * t_stpo = it_t_stpo * t_dep_data = it_t_dep_data * t_dep_descr = it_t_dep_descr * t_dep_order = it_t_dep_order * t_dep_source = it_t_dep_source * t_dep_doc = it_t_dep_doc * t_stpu = it_t_stpu EXCEPTIONS ERROR = 1 . " CSAP_MAT_BOM_MAINTAIN
IF SY-SUBRC EQ 0.   "All OK ELSEIF SY-SUBRC EQ 1. "Exception   "Add code for exception here ENDIF.

ABAP code to compare 7.40 inline data declaration with original syntax

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_API03 ,
wa_t_stpo LIKE LINE OF it_t_stpo,
ld_o_stko TYPE STKO_API02 ,
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_alternative TYPE CSAP_MBOM-STLAL ,
it_t_dep_order TYPE STANDARD TABLE OF CSDEP_ORD ,
wa_t_dep_order LIKE LINE OF it_t_dep_order,
ld_valid_from TYPE CSAP_MBOM-DATUV ,
it_t_dep_source TYPE STANDARD TABLE OF CSDEP_SORC ,
wa_t_dep_source LIKE LINE OF it_t_dep_source,
ld_change_no TYPE CSAP_MBOM-AENNR ,
it_t_dep_doc TYPE STANDARD TABLE OF CSDEP_DOC ,
wa_t_dep_doc LIKE LINE OF it_t_dep_doc,
ld_revision_level TYPE CSAP_MBOM-REVLV ,
ld_i_stko TYPE STKO_API01 ,
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_bom_create TYPE CSDATA-XFELD ,
ld_fl_new_item TYPE CSDATA-XFELD ,
ld_fl_default_values TYPE CSDATA-XFELD .


DATA(ld_fl_warning). = 'some text here'

DATA(ld_material). = 'some text here'

"populate fields of struture and append to itab
append wa_t_stpo to it_t_stpo.
ld_o_stko = 'Check type of data required'.

DATA(ld_plant). = 'some text here'

"populate fields of struture and append to itab
append wa_t_dep_data to it_t_dep_data.

DATA(ld_bom_usage). = 'some text here'

"populate fields of struture and append to itab
append wa_t_dep_descr to it_t_dep_descr.

DATA(ld_alternative). = 'some text here'

"populate fields of struture and append to itab
append wa_t_dep_order to it_t_dep_order.

DATA(ld_valid_from). = 'some text here'

"populate fields of struture and append to itab
append wa_t_dep_source to it_t_dep_source.

DATA(ld_change_no). = 'some text here'

"populate fields of struture and append to itab
append wa_t_dep_doc to it_t_dep_doc.

DATA(ld_revision_level). = 'some text here'
ld_i_stko = 'Check type of data required'.

DATA(ld_fl_no_change_doc). = 'some text here'

"populate fields of struture and append to itab
append wa_t_stpu to it_t_stpu.

DATA(ld_fl_bom_create). = 'some text here'

DATA(ld_fl_new_item). = 'some text here'

DATA(ld_fl_default_values). = 'some text here'.

SAP Documentation for FM CSAP_MAT_BOM_MAINTAIN


You can use function module CSAP_MAT_BOM_MAINTAIN to process simple material BOMs. ...See here for full SAP fm documentation