Good day Experts,
I am working on LSMW to mass update standard address details associated with Business Partners. I need to update the standard BP address given in an input file (because we are doing a mass update). I tried to use BAPI_BUPA_ADDRESS_CHANGE to update the standard BP address, however, still the standard address (which is BP transaction under Address usage-Standard Address) shows the old value.
Can somebody tell me what logical error I am making (because I dont get any error in RETURN table) to update (or if I am missing to pass any value)? Also, is this the right BAPI to use?
For reference, inline is my code.
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
IF zinput-street IS NOT INITIAL.
gs_address-street = zinput-street.
gs_addressx-street = ‘X’.
ENDIF.
IF zinput-post_code IS NOT INITIAL.
gs_address-postl_cod1 = zinput-post_code.
gs_addressx-postl_cod1 = ‘X’.
ENDIF.
IF zinput-city IS NOT INITIAL.
gs_address-city = zinput-city.
gs_addressx-city = ‘X’.
ENDIF.
CLEAR lv_partner.
lv_partner = zinput-partner.
gs_address-standardaddress = ‘X’.
CALL FUNCTION ‘BAPI_BUPA_ADDRESS_CHANGE’
EXPORTING
businesspartner = lv_partner
ADDRESSGUID = lv_guid1
ADDRESSDATA = gs_address
ADDRESSDATA_X = gs_addressx
TABLES
RETURN = lt_return.
DELETE lt_return WHERE type CA ‘SWI’.
IF lt_return[] IS INITIAL.
CALL FUNCTION ‘BAPI_TRANSACTION_COMMIT’
EXPORTING
wait = ‘X’.
WRITE:/ zinput-partner, ‘Additional address created’.
ELSE.
WRITE:/ zinput-partner,
‘Additional address not created’.
CALL FUNCTION ‘BAPI_TRANSACTION_ROLLBACK’.
CLEAR lv_msg.
LOOP AT lt_return INTO ls_return.
CALL FUNCTION ‘FORMAT_MESSAGE’
EXPORTING
id = ls_return-id
no = ls_return-number
v1 = ls_return-message_v1
v2 = ls_return-message_v2
v3 = ls_return-message_v3
v4 = ls_return-message_v4
IMPORTING
msg = lv_msg
EXCEPTIONS
not_found = 1
OTHERS = 2.
IF sy-subrc = 0.
* Implement suitable error handling here
WRITE:/ zinput-partner, lv_msg.
ENDIF.
CLEAR ls_return.
ENDLOOP.
ENDIF.
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Many thanks for your help in advance.