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

update vendor address using BAPI_ADDRESSORG_CHANGE

Former Member
0 Likes
3,152

Please tell me how to make bapi BAPI_ADDRESSORG_CHANGE or BAPI_ADDRESSORG_SAVEREPLICA save the vendor address data.

I am trying to update the vendor address details using bapi BAPI_ADDRESSORG_CHANGE or BAPI_ADDRESSORG_SAVEREPLICA since the IDoc type CREMAS does not cater for all the vendor address fields in transaction XK01 of FK01.

The BAPI give no error and it returns with an address number, but when I go to transaction I find that it did not update. I call the bapi as follows:

CALL FUNCTION 'BAPI_ADDRESSORG_CHANGE'

EXPORTING

obj_type = 'LFA1'

obj_id = lv_lifnr

OBJ_ID_EXT = ' '

CONTEXT = 1

ACCEPT_ERROR = ' '

SAVE_ADDRESS = 'X'

IV_CHECK_ADDRESS = 'X'

IV_TIME_DEPENDENT_COMM_DATA = ' '

IMPORTING

ADDRESS_NUMBER = lv_address_number

TABLES

BAPIAD1VL = t_bapiad1vl

BAPIADTEL = t_bapiadtel

BAPICOMREM = t_bapicomrem

BAPIAD1VL_X = x_BAPIAD1VL

BAPIADTEL_X = x_BAPIADTEL

BAPICOMRE_X = x_BAPICOMREM

I populate my structures as follows:

t_bapiad1vl-extens_1 = '3278'.

x_bapiad1vl-extens_1 = 'X'.

t_bapiad1vl-house_no = '100'.

x_bapiad1vl-house_no = 'X'.

t_bapiad1vl-str_suppl1 = 'BROADCAST HOUSE'. "Building: street2.

x_bapiad1vl-str_suppl1 = 'X'.

*t_bapiad1vl-extens_1 = '3278'.

*t_bapiad1vl-house_no = '100'.

*t_bapiad1vl-str_suppl1 = 'BROADCAST HOUSE'. "Building: street2.

*

APPEND t_bapiad1vl.

APPEND x_bapiad1vl.

t_bapicomrem-comm_type = 'SSF'.

x_bapicomrem-comm_type = 'X'.

APPEND t_bapicomrem.

t_bapiadtel-extension = '1111'.

x_bapiadtel-extension = 'X'.

t_bapiadtel-telephone = '1111111111'.

x_bapiadtel-telephone = 'X'.

APPEND t_bapiadtel.

lv_lifnr = '0005000102'.

Please tell me how to make bapi BAPI_ADDRESSORG_CHANGE or BAPI_ADDRESSORG_SAVEREPLICA save the vendor address data.

I am trying to update the vendor address details using bapi BAPI_ADDRESSORG_CHANGE or BAPI_ADDRESSORG_SAVEREPLICA since the IDoc type CREMAS does not cater for all the vendor address fields in transaction XK01 of FK01.

The BAPI give no error and it returns with an address number, but when I go to transaction I find that it did not update. I call the bapi as follows:

CALL FUNCTION 'BAPI_ADDRESSORG_CHANGE'

EXPORTING

obj_type = 'LFA1'

obj_id = lv_lifnr

OBJ_ID_EXT = ' '

CONTEXT = 1

ACCEPT_ERROR = ' '

SAVE_ADDRESS = 'X'

IV_CHECK_ADDRESS = 'X'

IV_TIME_DEPENDENT_COMM_DATA = ' '

IMPORTING

ADDRESS_NUMBER = lv_address_number

TABLES

BAPIAD1VL = t_bapiad1vl

BAPIADTEL = t_bapiadtel

BAPICOMREM = t_bapicomrem

BAPIAD1VL_X = x_BAPIAD1VL

BAPIADTEL_X = x_BAPIADTEL

BAPICOMRE_X = x_BAPICOMREM

I populate my structures as follows:

t_bapiad1vl-extens_1 = '3278'.

x_bapiad1vl-extens_1 = 'X'.

t_bapiad1vl-house_no = '100'.

x_bapiad1vl-house_no = 'X'.

t_bapiad1vl-str_suppl1 = 'BROADCAST HOUSE'. "Building: street2.

x_bapiad1vl-str_suppl1 = 'X'.

*t_bapiad1vl-extens_1 = '3278'.

*t_bapiad1vl-house_no = '100'.

*t_bapiad1vl-str_suppl1 = 'BROADCAST HOUSE'. "Building: street2.

*

APPEND t_bapiad1vl.

APPEND x_bapiad1vl.

t_bapicomrem-comm_type = 'SSF'.

x_bapicomrem-comm_type = 'X'.

APPEND t_bapicomrem.

t_bapiadtel-extension = '1111'.

x_bapiadtel-extension = 'X'.

t_bapiadtel-telephone = '1111111111'.

x_bapiadtel-telephone = 'X'.

APPEND t_bapiadtel.

lv_lifnr = '0005000102'.

8 REPLIES 8
Read only

Former Member
0 Likes
1,461

Try calling the function module BAPI_TRANSACTION_COMMIT

after you are done with the process

Sricvathsan

Read only

Former Member
0 Likes
1,461

Hi Srivathsan Kannan

I am calling the BAPI_TRANSACTION_COMMIT, but it still does not do the update.

Read only

Former Member
0 Likes
1,461

Hi,

Try with this BAPI.

<b>BAPI_BUPA_ADDRESS_CHANGE</b>

Regards

Vijay

Read only

0 Likes
1,461

Hi Vijay,

Please help me in the following.

As Vendor/Customer Master dont have all the address fields ( like Street4-5), we use FM BAPI_ADDRESSORG_SAVEREPLICA to overcome this problem.

In my case i have created one Custom load program to upload address data using

BAPI_ADDRESSORG_SAVEREPLICA and then LSMW project to upload rest of the data.

In this case when i upload rest of the data by LSMW using BI standard program ( having NODATA indicator "/" in my source file for the fields already uploaded using BAPI above) , address data which uploaded through FM should get populate automatically (by concept of Central Address management) but in my case <b>for some of the Account Group it is not getting populated,</b> please suggest.

regards

Sonal

Read only

Former Member
0 Likes
1,461

Hi Vijay Babu Dudla

This will not work as my vendor are not created as business partners.

Read only

Former Member
0 Likes
1,461

Hello Geoige,

From the code which u have posted it is not clear if u have also updated table BAPIAD1VL_X & BAPIADTEL_X for the field updateflag. It should be set to U for update.

Read only

Former Member
0 Likes
1,461

Hi Abhijit Dani

I have updated those x structures as well. I discovered that the structure bapiadtel is updating, but bapiad1vl and bapicomrem do not update. Another thing I have noticed is that the bapi only runs successfully if the context field is set to '0001' which is Main vendor address, otherwise it doesn't.

Read only

0 Likes
1,461

Make sure you assign following value to the from_date field

zlt_bapiad1vl-from_date = '00010101'.

"this is a standard sap value

append zlt_bapiad1vl to ztt_bapiad1vl.