PP Function module RFC Used the same way in S/4HANA

CSAP_MAT_BOM_CREATE Create Material BOM

Creates a material BOM with header, items and sub-items for a material, plant and BOM usage, like CS01. It is widely used in BOM migration and in uploads from CAD or PLM systems. The API structures use character fields, so pass quantities and dates in the user's external format, and handle the ERROR exception and FL_WARNING.

Function group
CSAP
Remote-enabled (RFC)
Yes
Type
Function module

Importing parameters

ParameterTypeDescriptionRequired
MATERIALCSAP_MBOM-MATNRMaterial numberYes
PLANTCSAP_MBOM-WERKSPlant—
BOM_USAGECSAP_MBOM-STLANBOM usageYes
VALID_FROMCSAP_MBOM-DATUVValid-from date—
CHANGE_NOCSAP_MBOM-AENNRChange number—
REVISION_LEVELCSAP_MBOM-REVLVRevision level—
I_STKOSTKO_API01BOM header dataYes
FL_COMMIT_AND_WAITCAPIFLAG-COMM_WAITCommit and wait for update—
FL_NO_CHANGE_DOCCAPIFLAG-NO_CHG_DOCDo not write change documents—
FL_DEFAULT_VALUESCSDATA-XFELDUse default values for new items—

Exporting parameters

ParameterTypeDescription
FL_WARNINGCAPIFLAG-FLWARNINGLog contains warnings
BOM_NOSTKO_API02-BOM_NOBOM number

Tables parameters

ParameterTypeDescriptionRequired
T_STPOSTPO_API01BOM items—
T_STPUSTPU_API01BOM sub-items—
T_LTX_LINECSLTX_LINEBOM long texts—

Exceptions

  • ERROR — Error occurred (see log)

Call template (ABAP)

A skeleton generated from the interface. It lists mandatory importing parameters, exporting parameters and tables; declare the variables with suitable types in your own program.

CALL FUNCTION 'CSAP_MAT_BOM_CREATE'
  EXPORTING
    material = lv_material
    bom_usage = lv_bom_usage
    i_stko = lv_i_stko
  IMPORTING
    fl_warning = lv_fl_warning
    bom_no = lv_bom_no
  TABLES
    t_stpo = lt_t_stpo
    t_stpu = lt_t_stpu
    t_ltx_line = lt_t_ltx_line
  EXCEPTIONS
    error = 1
    OTHERS = 2.

Related tables

Can't find the report you need?

We also build anything that is not in the catalog. Describe it briefly and we will suggest the right solution.

Request a custom report