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

BAPI_BATCH_CHANGE Change Batch

Changes the attributes of an existing batch, such as expiration date, vendor batch or next inspection date, like transaction MSC2N. It is used for mass updates of batch data from quality or warehouse systems. Mark every field you change in BATCHATTRIBUTESX, pass the plant if batches are plant-specific, check RETURN and call BAPI_TRANSACTION_COMMIT.

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

Importing parameters

ParameterTypeDescriptionRequired
MATERIALBAPIBATCHKEY-MATERIALMaterial numberYes
BATCHBAPIBATCHKEY-BATCHBatch numberYes
PLANTBAPIBATCHKEY-PLANTPlant—
BATCHATTRIBUTESBAPIBATCHATTBatch attributesYes
BATCHATTRIBUTESXBAPIBATCHATTXChange flags for batch attributesYes
BATCHCONTROLFIELDSBAPIBATCHCTRLControl parameters—
INTERNALNUMBERCOMBAPIBNCOMData for internal number assignment—
EXTENSION1BAPIBNCOMZCustomer data for number assignment—
MATERIAL_LONGBAPIBATCHKEY-MATERIAL_LONGMaterial number (long)—

Exporting parameters

ParameterTypeDescription
BATCHATTRIBUTESBAPIBATCHATTBatch attributes after the change

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_CHANGE'
  EXPORTING
    material = lv_material
    batch = lv_batch
    batchattributes = lv_batchattributes
    batchattributesx = lv_batchattributesx
  IMPORTING
    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