Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

Update City name in Contract using BAPI

0 Kudos

Hi,

We have requirement to update partner city in contract ( VA42 ) using BAPI_CUSTOMERCONTRACT_CHANGE. It is working as expected but remaining address fields except city are updating with blank including email address.

Can you please suggest a solution? how we can update only city without touching the remaining fields.

Sample code:

APPEND VALUE #( DOCUMENT = LS_DATA-VBELN
ITM_NUMBER = LS_DATA-POSNR
UPDATEFLAG = LC_U
PARTN_ROLE = LS_DATA-PARVW
P_NUMB_OLD = LS_DATA-KUNNR
P_NUMB_NEW = LS_DATA-KUNNR
ADDR_LINK = LS_DATA-ADRNR
ADDRESS = LS_DATA-ADRNR ) TO LT_PARTNERCHANGES.


APPEND VALUE #( ADDR_NO = LS_DATA-ADDRNUMBER
CITY = LS_DATA-CITY1 ) TO LT_PARTNERADDRESSES.


LS_CONTRACT_HEADER_INX-UPDATEFLAG = LC_U.
" Call BAPI for Contract change.
CALL FUNCTION 'BAPI_CUSTOMERCONTRACT_CHANGE'
EXPORTING
SALESDOCUMENT = LS_DATA-VBELN
CONTRACT_HEADER_IN = LS_CONTRACT_HEADER_IN
CONTRACT_HEADER_INX = LS_CONTRACT_HEADER_INX
* LOGIC_SWITCH = LV_LOGIC_SWITCH
SIMULATION = P_TEST
TABLES
RETURN = LT_RETURN
PARTNERCHANGES = LT_PARTNERCHANGES
PARTNERADDRESSES = LT_PARTNERADDRESSES.

Thanks in advance,

Venkat.

1 REPLY 1

raymond_giuseppi
Active Contributor
0 Kudos

Seems you must first fill PARTNERADDRESSES with current values of address (check ADDR_CONVERT_TO_BAPIADDR1 or BAPISDORDER_GETDETAILEDLIST?)