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: 

How to update BP data

Former Member
0 Kudos

Hi All,

I have a scenario here where we are fetching business partner related data from a non SAP system and matching it with the data present in our system. If it is not matching we have to update/change it in our system. The fields which are used for matching are

1. First name 2. Last name 3. email 4.mob no 5.tel. no 6. business unit 7. functional area 8. country

Please let me know how to achieve this.Is there some BAPI which can update all these fields?

Thanks in advance,

Saket

6 REPLIES 6

SuhaSaha
Advisor
Advisor
0 Kudos

1. To read the BUsiness PArtner (BUPA) address details you can use the BAPI 'BAPI_BUPA_ADDRESS_GETDETAIL'.

2. To update the BUPA address details you can use 'BAPI_BUPA_ADDRESS_CHANGE'.

Read the BAPI documentation before implementing them in your code. If you still face any problems search in SDN similar requirements have been discussed in this forum.

BR,

Suhas

Former Member
0 Kudos

Hello,

Please try this BAPI_BUSINESS_PARTNER_CHANGE.

Regards

Hiren

0 Kudos

Thanks for suggestions. But none of them is working. I have found a FM CRM_WAP_BP_CHANGE which changes the first name but not the last name. Can someone please tell me a BAPI/FM to change the last name and other BP related data as weel.

Thanks in Advance,

Saket.

0 Kudos

BAPI_BUPA* function modules provide this capability, particularly noted BAPI_BUPA_CENTRAL_CHANGE. For these, you would need to populate the _X version of the structures/tables with the data element to be changed, and call the COMMIT bapi afterward to update the database.

Former Member
0 Kudos

Thanks Hiren it had finally worked.

Former Member
0 Kudos

Hi Saket,

I am trying to update BP data.Now I have a question that I need to update tel and mob,but there only mob can update successfully.I don't know why.

I need your help.Part of my code as following.

........

IF iv_tel IS NOT INITIAL.
     IF lt_tel[] IS NOT INITIAL.
       "DELETE lt_tel WHERE r_3_user = '1' .
       lt_tel_x-updateflag = 'U'.
       lt_tel_x-telephone = 'X'.
       lt_tel_x-r_3_user = 'X'.
       APPEND lt_tel_x.
     ELSE.
       lt_tel_x-updateflag = 'I'.
       lt_tel_x-telephone = 'X'.
       lt_tel_x-r_3_user = 'X'.
       APPEND lt_tel_x.
     ENDIF.

      CLEAR lt_tel[].

     lt_tel-country = 'CN'.
     lt_tel-telephone = iv_tel.
     lt_tel-r_3_user = '1'.
     APPEND lt_tel.
   ENDIF.

   IF iv_mob IS NOT INITIAL.
     IF lt_tel[] IS NOT INITIAL.
       "DELETE lt_tel WHERE r_3_user = '3' .
       lt_tel_x-updateflag = 'U'.
       lt_tel_x-telephone = 'X'.
       lt_tel_x-r_3_user = 'X'.
       APPEND lt_tel_x.
     ELSE.
       lt_tel_x-updateflag = 'I'.
       lt_tel_x-telephone = 'X'.
       lt_tel_x-r_3_user = 'X'.
       APPEND lt_tel_x.
     ENDIF.

     CLEAR lt_tel[].

     lt_tel-country = 'CN'.
     lt_tel-telephone = iv_mob.
     lt_tel-r_3_user = '3'.
     APPEND lt_tel.
   ENDIF.

   CALL FUNCTION 'BAPI_BUPA_ADDRESS_CHANGE'
     EXPORTING
       businesspartner = iv_customerno
       addressdata     = lt_addressdata
       addressdata_x   = lt_addressdata_x
     TABLES
       bapiadtel       = lt_tel
       bapiadsmtp      = lt_email
       bapiadtel_x     = lt_tel_x
       bapiadsmt_x     = lt_email_x
       return          = lt_return4.
 
   IF sy-subrc = 0.
     CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
       EXPORTING
         wait = 'X'.
     ev_flag = 'Y'.
   ELSE.
     ev_flag = 'E'.
   ENDIF.