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

ParameterTypeDescriptionRequired
SALESDOCUMENTBAPIVBELN-VBELNSales document numberYes
CONTRACT_HEADER_INBAPISDH1Contract header dataYes
CONTRACT_HEADER_INXBAPISDH1XContract header change flags (X structure)Yes
SIMULATIONBAPIFLAG-BAPIFLAGSimulation mode (no update)—
LOGIC_SWITCHBAPISDLSSD logic switch (pricing, ATP control)—
NO_STATUS_BUF_INITBAPIFLAG-BAPIFLAGDo not refresh status buffer—

Tables parameters

ParameterTypeDescriptionRequired
RETURNBAPIRET2Return messagesYes
CONTRACT_ITEM_INBAPISDITMContract item data—
CONTRACT_ITEM_INXBAPISDITMXContract item change flags (X structure)—
PARTNERSBAPIPARNRDocument partners—
PARTNERCHANGESBAPIPARNRCPartner changes—
CONDITIONS_INBAPICONDPricing conditions—
CONDITIONS_INXBAPICONDXCondition change flags (X structure)—
CONTRACT_DATA_INBAPICTRContract data (validity, dates)—
CONTRACT_DATA_INXBAPICTRXContract data change flags (X structure)—
CONTRACT_TEXTBAPISDTEXTTexts—
CONTRACT_KEYSBAPISDKEYReference keys of created objects—
EXTENSIONINBAPIPAREXCustomer 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.

Request a custom report