‎2010 Jun 29 4:28 AM
Hi SAP Experts,
I have a requirement to update the address of one customer using the address of another customer. What I did is that I used 'BAPI_ADDRESSORG_GETDETAIL' to select the address details of customer2 and stored it in t_bapiad1vl_x. Now I checked if each field in t_bapiad1vl is not initial I would put an 'X' to corresponding field in table t_bapiad1vl_x and populated t_bapiad1vl_x-upadate = 'U'. Now the problem is when I execute the program, customer1 is updated with values that are not in customer2. For example District field in customer2 is blank but when I run the program customer1's district field is populated. What could be the problem causing this and what could be an alternative to my requirement? Thank you in advance! (below is how I called BAPI_ADDRESSORG_CHANGE)
CALL FUNCTION 'BAPI_ADDRESSORG_CHANGE'
EXPORTING
obj_type = lc_kna1
obj_id = l_kunnr
context = lc_0001
save_address = c_x
TABLES
bapiad1vl = t_bapiad1vl
bapiad1vl_x = t_bapiad1vl_x
return = x_return.
CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'.
‎2010 Jun 29 5:35 AM
Hello
Looks that in customer1 old data are remains.
In your case: let customer2 have District field blank. But if customer1 have this field not blank and you do not update this field - old value remains in this field.
So you must update all fields from customer2 to customer1 (not only filled )
‎2010 Jun 29 7:26 AM
Customer1 also has no value for district before the program run. I do not know where the additional values were coming from.