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
| Parameter | Type | Description | Required |
|---|---|---|---|
| MATERIAL | BAPIBATCHKEY-MATERIAL | Material number | Yes |
| BATCH | BAPIBATCHKEY-BATCH | Batch number (empty = internal number) | — |
| PLANT | BAPIBATCHKEY-PLANT | Plant | — |
| BATCHATTRIBUTES | BAPIBATCHATT | Batch attributes | — |
| BATCHCONTROLFIELDS | BAPIBATCHCTRL | Control parameters | — |
| BATCHSTORAGELOCATION | BAPIBATCHSTOLOC-STGE_LOC | Storage location | — |
| 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 |
|---|---|---|
| BATCH | BAPIBATCHKEY-BATCH | Created batch number |
| BATCHATTRIBUTES | BAPIBATCHATT | Batch attributes after creation |
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_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.