I am trying to edit an existing contract in R/3. I am using the FM 'BAPICUSTOMERCONTRACT_CHANGE' but not able to achieve the desired result.
Actually, there is a contract existing with number say 1234, having 4 Items with Item numbers say 100,101,102,103. Now i am trying to update the item details of 100.
Initial values present for item 100 :- Material - H51-YY001, Quantity = 2
Now i am trying to update the Material to H49-XX014 and quantity to 5
d_VBELN = '50000172'.
contract_header_inx-updateflag = 'U'.
contract_items_in-itm_number = '100'.
contract_items_in-material = 'H51-YY019'.
contract_items_in-target_qty = '2'.
contract_items_inx-updateflag = 'U'.
contract_items_inx-itm_number = '100'.
contract_items_inx-material = 'X'.
contract_items_inx-target_qty = 'X'.
CALL FUNCTION 'BAPI_CUSTOMERCONTRACT_CHANGE'
SALESDOCUMENT = D_VBELN
contract_header_in = contract_header_in
contract_header_inx = contract_header_inx
return = return
contract_item_in = contract_items_in
contract_item_inx = contract_items_inx.
CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'.
Can some one tell me how to achieve this.
All helpful answers will b rewarded.