Application Development and Automation 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: 
Read only

BAPI_ADDRESSORG_CHANGE problem

Former Member
0 Likes
711

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'.

2 REPLIES 2
Read only

Former Member
0 Likes
534

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 )

Read only

0 Likes
534

Customer1 also has no value for district before the program run. I do not know where the additional values were coming from.