SD
BAPI
RFC
Used the same way in S/4HANA
BAPI_CUSTOMERCONTRACT_CHANGE Change Customer Contract
Changes an existing sales contract, like VA42: header, items, partners, conditions and contract data such as validity periods. It is used for contract renewals and price updates from external systems. Both CONTRACT_HEADER_IN and CONTRACT_HEADER_INX are mandatory here; set the X flags for changed fields and call BAPI_TRANSACTION_COMMIT afterwards only when RETURN contains no message of type E or A.
- Function group
- 2034
- Remote-enabled (RFC)
- Yes
- Type
- BAPI
Importing parameters
| Parameter | Type | Description | Required |
|---|---|---|---|
| SALESDOCUMENT | BAPIVBELN-VBELN | Sales document number | Yes |
| CONTRACT_HEADER_IN | BAPISDH1 | Contract header data | Yes |
| CONTRACT_HEADER_INX | BAPISDH1X | Contract header change flags (X structure) | Yes |
| SIMULATION | BAPIFLAG-BAPIFLAG | Simulation mode (no update) | — |
| LOGIC_SWITCH | BAPISDLS | SD logic switch (pricing, ATP control) | — |
| NO_STATUS_BUF_INIT | BAPIFLAG-BAPIFLAG | Do not refresh status buffer | — |
Tables parameters
| Parameter | Type | Description | Required |
|---|---|---|---|
| RETURN | BAPIRET2 | Return messages | Yes |
| CONTRACT_ITEM_IN | BAPISDITM | Contract item data | — |
| CONTRACT_ITEM_INX | BAPISDITMX | Contract item change flags (X structure) | — |
| PARTNERS | BAPIPARNR | Document partners | — |
| PARTNERCHANGES | BAPIPARNRC | Partner changes | — |
| CONDITIONS_IN | BAPICOND | Pricing conditions | — |
| CONDITIONS_INX | BAPICONDX | Condition change flags (X structure) | — |
| CONTRACT_DATA_IN | BAPICTR | Contract data (validity, dates) | — |
| CONTRACT_DATA_INX | BAPICTRX | Contract data change flags (X structure) | — |
| CONTRACT_TEXT | BAPISDTEXT | Texts | — |
| CONTRACT_KEYS | BAPISDKEY | Reference keys of created objects | — |
| EXTENSIONIN | BAPIPAREX | Customer enhancement fields (EXTENSIONIN) | — |
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_CUSTOMERCONTRACT_CHANGE'
EXPORTING
salesdocument = lv_salesdocument
contract_header_in = lv_contract_header_in
contract_header_inx = lv_contract_header_inx
TABLES
return = lt_return
contract_item_in = lt_contract_item_in
contract_item_inx = lt_contract_item_inx
partners = lt_partners
partnerchanges = lt_partnerchanges
conditions_in = lt_conditions_in
conditions_inx = lt_conditions_inx
contract_data_in = lt_contract_data_in
contract_data_inx = lt_contract_data_inx
contract_text = lt_contract_text.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.