‎2007 Mar 12 5:29 PM
Hi,
I am using this BAPI BAPI_ADDRESSORG_CHANGE to insert Email addresses in the existing vendors. But along with this I need to insert value ADRT-Remark field and also change the standard comm type field (Seen in XK02). I am not able to figure out what fields I should be using from the BAPI to update the same. Can you please help ?
‎2007 Mar 12 5:39 PM
H Vaibhav,
Try using the table BAPIAD_REM for address comments/remarks in BAPI_ADDRESSORG_CHANGE. (Do not forget the populate BAPIAD_RE_X)
Let me know if it solves ur problem.
BR
Rakesh
‎2007 Mar 13 11:43 AM
Hi,
This doesnt seem to help. It does not update the notes field (remark) along with the email address . Below the the code to populate the bapi
Also which field do I change to update the default communication type ?
BAPIADCOMREM doesn't seem to work.
WA_SMTP-E_MAIL = '[email protected]'.
APPEND WA_SMTP TO LT_SMTP.
wa_smtp-e_mail = '[email protected]'.
APPEND WA_SMTP TO LT_SMTP.
WA_COMREM-COMM_TYPE = 'INT'.
WA_COMREM-LANGU = 'EN'.
WA_COMREM-COMM_NOTES = 'TEST'.
WA_COMREM-CONSNUMBER = '001'.
APPEND WA_COMREM TO LT_COMREM.
WA_COMREM-COMM_TYPE = 'INT'.
WA_COMREM-LANGU = 'EN'.
WA_COMREM-COMM_NOTES = 'TEST'.
WA_COMREM-CONSNUMBER = '001'.
APPEND WA_COMREM TO LT_COMREM.
WA_ADSMT-E_MAIL = 'X'.
WA_ADSMT-CONSNUMBER = 'X'.
WA_ADSMT-UPDATEFLAG = 'I'.
WA_ADSMT-E_MAIL = 'X'.
WA_ADSMT-CONSNUMBER = 'X'.
WA_ADSMT-UPDATEFLAG = 'I'.
APPEND WA_ADSMT TO LT_ADSMT.
WA_ADSMT-E_MAIL = 'X'.
WA_ADSMT-CONSNUMBER = 'X'.
WA_ADSMT-UPDATEFLAG = 'I'.
WA_ADSMT-E_MAIL = 'X'.
WA_ADSMT-CONSNUMBER = 'X'.
WA_ADSMT-UPDATEFLAG = 'I'.
APPEND WA_ADSMT TO LT_ADSMT.
WA_COMRE-COMM_TYPE = 'X'.
WA_COMRE-LANGU = 'X'.
WA_COMRE-COMM_NOTES = 'X'.
WA_COMRE-CONSNUMBER = 'X'.
WA_COMRE-UPDATEFLAG = 'I'.
APPEND WA_COMRE TO LT_COMRE.
WA_COMRE-COMM_TYPE = 'X'.
WA_COMRE-LANGU = 'X'.
WA_COMRE-COMM_NOTES = 'X'.
WA_COMRE-CONSNUMBER = 'X'.
WA_COMRE-UPDATEFLAG = 'I'.
APPEND WA_COMRE TO LT_COMRE.
**************************************************
WA_ADREM-ADR_NOTES = ''.
APPEND WA_ADREM TO LT_ADREM.
WA_ADREX-ADR_NOTES = 'X'.
WA_ADREX-UPDATEFLAG = 'I'.
APPEND WA_ADREX TO LT_ADREX.
WA_ADREM-ADR_NOTES = 'R'.
APPEND WA_ADREM TO LT_ADREM.
WA_ADREX-ADR_NOTES = 'X'.
WA_ADREX-UPDATEFLAG = 'I'.
APPEND WA_ADREX TO LT_ADREX.
*****************************************************
CALL FUNCTION 'BAPI_ADDRESSORG_CHANGE'
EXPORTING
OBJ_TYPE = GC_LFA1
OBJ_ID = lv_VENDOR
CONTEXT = GC_0001
SAVE_ADDRESS = 'X'
IV_CHECK_ADDRESS = 'X'
IMPORTING
ADDRESS_NUMBER = LV_ADRNR
TABLES
BAPIADSMTP = LT_SMTP
BAPIAD_REM = LT_ADREM
BAPIADSMT_X = LT_ADSMT
BAPICOMRE_X = LT_COMRE
BAPIAD_RE_X = LT_ADREX
RETURN = LT_RETURN
‎2007 Sep 20 4:03 PM
hi plz help me
for updating remarks field if any one got the solution
the same thing i am doing but i am not able to update remak field , which must be refrected in XD03 for the customer
‎2016 Jul 22 8:46 AM
Hi,
I have the same requirement , to update this field REMARK for customer using ABAP code.
Can you please help me ?
Thank you !
Harish Bhatt
‎2016 Jul 27 4:51 PM
Hello,
I got success to update REMARK field in ADRT table.
We can do following steps :
Get Sequence number:
CALL FUNCTION 'ADDR_SELECT_ADRCOMC_SINGLE'
EXPORTING
addrnumber = p_adrnr "Address Number
TABLES
et_adrcomc = lt_adrcomc.
IF sy-subrc EQ 0.
SORT lt_adrcomc BY comm_type.
READ TABLE lt_adrcomc
INTO ls_adrcomc
WITH KEY comm_type = 'INT'
BINARY SEARCH.
IF sy-subrc EQ 0.
ls_commtab-consnumber = ls_adrcomc-high_value + 1. "Sequence Number
ENDIF.
ENDIF.
ls_commtab-smtp_addr = p_email. "Email Address
ls_commtab-remark = p_remark. "Remark to add
ls_commtab-updateflag = 'I'. "Flag for insert
APPEND ls_commtab TO lt_commtab.
Update Remark in XD02 (ADRT table)
CALL FUNCTION 'ADDR_COMM_MAINTAIN'
EXPORTING
address_number = p_adrnr "Address Number
date_from = '00010101'
language = sy-langu
table_type = 'ADSMTP' "Constant
check_address = 'X'
iv_time_dependence = 'X'
iv_consider_adrcomc_for_insert = 'X'
IMPORTING
returncode = lv_return
TABLES
comm_table = lt_commtab.
IF sy-subrc = 0.
IF p_test IS INITIAL.
CALL FUNCTION 'ADDR_MEMORY_SAVE'.
ENDIF.
IF sy-subrc = 0.
WRITE : / 'Table ADRT is updated successfully for address :',
p_adrnr.
ENDIF.
ELSE.
WRITE : / 'Error- Table ADRT is not updated for address : ',
p_adrnr.
ENDIF.
Once data is updated in remark field of ADRT table, it will be reflected in XD02 also.
Please let me know if I am not clear enough.
Thank you !
Harish Bhatt