CA BAPI RFC Used the same way in S/4HANA

BAPI_BATCH_CREATE Create Batch

Creates a batch master record for a material, optionally at plant level and with batch attributes such as production date and shelf-life expiration date, like transaction MSC1N. It is used in interfaces from production or quality systems and in batch migration. Leave BATCH empty to get an internally assigned number, check RETURN and call BAPI_TRANSACTION_COMMIT; classification values are maintained separately, for example with BAPI_OBJCL_CHANGE.

Function group
VBWB
Remote-enabled (RFC)
Yes
Type
BAPI

Importing parameters

ParameterTypeDescriptionRequired
MATERIALBAPIBATCHKEY-MATERIALMaterial numberYes
BATCHBAPIBATCHKEY-BATCHBatch number (empty = internal number)—
PLANTBAPIBATCHKEY-PLANTPlant—
BATCHATTRIBUTESBAPIBATCHATTBatch attributes—
BATCHCONTROLFIELDSBAPIBATCHCTRLControl parameters—
BATCHSTORAGELOCATIONBAPIBATCHSTOLOC-STGE_LOCStorage location—
INTERNALNUMBERCOMBAPIBNCOMData for internal number assignment—
EXTENSION1BAPIBNCOMZCustomer data for number assignment—
MATERIAL_LONGBAPIBATCHKEY-MATERIAL_LONGMaterial number (long)—

Exporting parameters

ParameterTypeDescription
BATCHBAPIBATCHKEY-BATCHCreated batch number
BATCHATTRIBUTESBAPIBATCHATTBatch attributes after creation

Tables parameters

ParameterTypeDescriptionRequired
RETURNBAPIRET2Return messages—

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 'BAPI_BATCH_CREATE'
  EXPORTING
    material = lv_material
  IMPORTING
    batch = lv_batch
    batchattributes = lv_batchattributes
  TABLES
    return = lt_return.

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