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: 

Customer address version with BAPI

Former Member
0 Kudos

Hi All,

I have run through a lot of threads for maintainig International address version of customer with BAPI but could not succeed and need help. We tried using BAPI BAPI_BUPA_ADDRESS_ADD to add chinese version of customer address. On transaction commit, it does return a 32 char AddrsGUID but in database it is not updating or creating the address version (no records are added in ADRC or SADR table). It doesn't return any error code or message. We haev tried giving the WAIT parameter in BAPI_TRANSACTION_COMMIT.

1) Are we using the wrong BAPI ?

2) Is it true that this BAPI can't be tested in SE37 (i tried giving test seq with BAPI_TRANSACTION_COMMIT and same result -no database update).

3) Is there any other way? -we are able to add address with chinese version with standard tcode XD02 (so the language and localization settings are OK)

Below is the code that we are using to add the address version :

*&---------------------------------------------------------------------*

*& Report  ZBAPI_BUPA_ADDRESS

REPORT  zbapi_bupa_address.

DATA : addressdata TYPE bapibus1006_address,

       addressguid  TYPE  but020-guid,

       return TYPE TABLE OF bapiret2,

       lst_bapiad_rem TYPE bapiad_rem,

       bapiad_rem TYPE TABLE OF bapiad_rem.



addressdata-standardaddress = 'X'.

addressdata-city = '我的名字是'.
addressdata-str_suppl1 = 这是中国输出'.
addressdata-country = 'CN'.
addressdata-langu = 'ZH'.


lst_bapiad_rem-addr_vers = 'C'.
lst_bapiad_rem-langu = 'ZH'.
APPEND lst_bapiad_rem TO bapiad_rem.
CLEAR lst_bapiad_rem.


CALL FUNCTION 'BAPI_BUPA_ADDRESS_ADD'

  EXPORTING

    businesspartner              = '0001000XXX'

    addressdata                  = addressdata

*   DUPLICATE_MESSAGE_TYPE       =

*   ACCEPT_ERROR                 = ' '

IMPORTING

   addressguid                  = addressguid

TABLES

*   BAPIADTEL                    =

*   BAPIADFAX                    =

*   BAPIADTTX                    =

*   BAPIADTLX                    =

*   BAPIADSMTP                   =

*   BAPIADRML                    =

*   BAPIADX400                   =

*   BAPIADRFC                    =

*   BAPIADPRT                    =

*   BAPIADSSF                    =

*   BAPIADURI                    =

*   BAPIADPAG                    =

    bapiad_rem                   = bapiad_rem

*   BAPICOMREM                   =

*   ADDRESSUSAGE                 =

*   BAPIADUSE                    =

    return                       = return

*   ADDRESSDUPLICATES            =

.

IF sy-subrc = 0.



  DATA : l_wait TYPE bapita-wait,

         l_return TYPE bapiret2.



  l_wait = 'X'.

  COMMIT WORK AND WAIT.

  CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'

    EXPORTING

      wait   = l_wait

    IMPORTING

      return = l_return.

  CLEAR sy-msgno.

ENDIF.



CLEAR sy-msgno.

Pls. suggest.

thanks,

Binita

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Have you checked this class: CMD_EI_API? I am not sure if it work for your requirement, but you can give a try.

here u can find sample code for creation(U can modify the flags for update instead of insert):

5 REPLIES 5

Former Member
0 Kudos

Have you checked this class: CMD_EI_API? I am not sure if it work for your requirement, but you can give a try.

here u can find sample code for creation(U can modify the flags for update instead of insert):

atul_mohanty
Active Contributor
0 Kudos

Hi

To update ADRC for a customer , please check the BAPI

BAPI_ADDRESSORG_SAVEREPLICA.

Let us know, if it helps

0 Kudos

Hi Atul and Maju,

Thanks for replying.

I used BAPI BAPI_ADDRESSORG_SAVEREPLICA and it also worked! But there is one big problem with that.

To Avoid the error "please use another function to maintain the space version of the address" , I have added one more line with Add_Version as blank (default address). and One line is with Add_Version = 'C' (Chinese). Only If I pass it like this, it adds a new version to the address. BUT, I do not want to play with the original default version of address in english which would already be updated while creating customer with LSMW. If I dont pass anything in default address line, it overwrites the english address with blank values! is there any way I avoid this? or Use another BAPI ?

thanks,

Binita

0 Kudos

Hi,

Solved it. I was looking for the wrong BAPI. We do not want to create address number for the same customer but address version of the same address number.

I used the following three BAPI and it worked!

 

ADDR_VERSION_INSERT

ADDR_MEMORY_SAVE

ADDR_MEMORY_CLEAR

thanks,

Binita Joshi

0 Kudos

Hi Binita ,
Thanks for these BAPI, i am able to add the versions in ADRC but it's not reflecting as defined marked in the BP under International versions under the address tab in BP.

Can you please confirm, if this defined marked is appearing in your case?