Skip to Content
0
Jan 23, 2020 at 07:36 AM

Custom fields update using BAPI_CUSTOMERCONTRACT_CHANGE not working

213 Views Last edit Jan 23, 2020 at 07:56 AM 2 rev

Hello Experts,

I have scenario need to update the custom fields of VBAK using the BAPI_CUSTOMERCONTRACT_CHANGE which are not updating.

I have updated the fields which needs to be modified in bape_vbak and bape_vbakx like below and called the FM. But the custom fields are not updating in the contract.

MOVE 'BAPE_VBAK' TO gs_extension-structure.
MOVE-CORRESPONDING gs_vbak TO gs_bape_vbak.
gs_extension+30(960) = gs_bape_vbak.
APPEND gs_extension TO gt_extension.

MOVE 'BAPE_VBAKX' TO gs_extensionx-structure.
MOVE-CORRESPONDING gs_vbak TO gs_bape_vbakx.
gs_extensionx+30(960) = gs_bape_vbakx.
APPEND gs_extensionx TO gt_extensionx.

CALL FUNCTION 'BAPI_CUSTOMERCONTRACT_CHANGE'
EXPORTING
salesdocument = gv_vbeln
contract_header_in = gs_header1
contract_header_inx = gs_headerx1
* SIMULATION =
* BEHAVE_WHEN_ERROR = ' '
* INT_NUMBER_ASSIGNMENT = ' '
* LOGIC_SWITCH =
* NO_STATUS_BUF_INIT = ' '
TABLES
return = gt_return
* CONTRACT_ITEM_IN =
* CONTRACT_ITEM_INX =
partners = gt_partner
* PARTNERCHANGES =
* PARTNERADDRESSES =
* CONDITIONS_IN =
* CONDITIONS_INX =
* CONTRACT_CFGS_REF =
* CONTRACT_CFGS_INST =
* CONTRACT_CFGS_PART_OF =
* CONTRACT_CFGS_VALUE =
* CONTRACT_CFGS_BLOB =
* CONTRACT_CFGS_VK =
* CONTRACT_CFGS_REFINST =
* CONTRACT_TEXT =
contract_data_in = gt_con_data
contract_data_inx = gt_con_datax
* CONTRACT_KEYS =
extensionin = gt_extension
extensionex = gt_extensionx.