Skip to Content
author's profile photo Former Member
Former Member

BAPI_ADDRESSORG_CHANGE

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 ?

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

2 Answers

  • author's profile photo Former Member
    Former Member
    Posted on Mar 12, 2007 at 05: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

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member

      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 = 'DUMMY1@TEST.COM'.

      APPEND WA_SMTP TO LT_SMTP.

      wa_smtp-e_mail = 'TEST@DUMMY.COM'.

      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

  • author's profile photo Former Member
    Former Member
    Posted on Sep 20, 2007 at 03: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

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member Former Member

      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

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.