CA
BAPI
RFC
Used the same way in S/4HANA
BAPI_BATCH_SAVE_REPLICA Save Batch Replica (Create or Change)
Creates or changes a batch including its status and classification in one call; it is the inbound BAPI used for distributing batches between systems (ALE message type BATMAS). Developers use it when a batch must be replicated with the same number and characteristic values, for example from a central system. Fill the …X flag structures for the fields you pass, provide classification in the CLASSVALUATIONS tables, 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 | — |
| BATCHATTRIBUTESX | BAPIBATCHATTX | Change flags for batch attributes | — |
| BATCHSTATUS | BAPIBATCHSTATUS | Batch status | — |
| BATCHSTATUSX | BAPIBATCHSTATUSX | Change flags for batch status | — |
| 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) | — |
Tables parameters
| Parameter | Type | Description | Required |
|---|---|---|---|
| CLASSALLOCATIONS | BAPI3060_ALLOCATION | Class assignments | — |
| CLASSVALUATIONSNUM | BAPI3060_VALUATION_NUM | Numeric characteristic values | — |
| CLASSVALUATIONSCHAR | BAPI3060_VALUATION_CHAR | Character characteristic values | — |
| CLASSVALUATIONSCURR | BAPI3060_VALUATION_CURR | Currency characteristic values | — |
| 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_SAVE_REPLICA'
EXPORTING
material = lv_material
batch = lv_batch
TABLES
classallocations = lt_classallocations
classvaluationsnum = lt_classvaluationsnum
classvaluationschar = lt_classvaluationschar
classvaluationscurr = lt_classvaluationscurr
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.