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
| Parameter | Type | Description | Required |
|---|---|---|---|
| MATERIAL | BAPIBATCHKEY-MATERIAL | Material number | Yes |
| BATCH | BAPIBATCHKEY-BATCH | Batch number | Yes |
| PLANT | BAPIBATCHKEY-PLANT | Plant | — |
| BATCHATTRIBUTES | BAPIBATCHATT | Batch attributes | Yes |
| BATCHATTRIBUTESX | BAPIBATCHATTX | Change flags for batch attributes | Yes |
| BATCHCONTROLFIELDS | BAPIBATCHCTRL | Control parameters | — |
| INTERNALNUMBERCOM | BAPIBNCOM | Data for internal number assignment | — |
| EXTENSION1 | BAPIBNCOMZ | Customer data for number assignment | — |
| MATERIAL_LONG | BAPIBATCHKEY-MATERIAL_LONG | Material number (long) | — |
Exporting parameters
| Parameter | Type | Description |
|---|---|---|
| BATCHATTRIBUTES | BAPIBATCHATT | Batch attributes after the change |
Tables parameters
| Parameter | Type | Description | Required |
|---|---|---|---|
| RETURN | BAPIRET2 | Return 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.