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: 

Function module to update vendor communication address

Former Member
0 Kudos
714

Hi Experts,

Can anyone give me an idea,which function module is used to update vendor communication address details.As I have tried the function module 'ADDR_SAVE_INTERN' but there is no web address field.

**points will be rewarded

Regards,

Naresh.

3 REPLIES 3

Former Member
0 Kudos
123

Have a look at ADDR_COMM_MAINTAIN.

It's a complicated one though...

Former Member
0 Kudos
123

You will need to call function module 'ADDR_MEMORY_SAVE' as well. Maybe that already solves your problem...

If not, here's an example that works for me. It does use a macro though... Not nice but flexible.

* ----------------------------------------------------------------------
* DEFINITION
* ----------------------------------------------------------------------
  DEFINE comm_maintain.

    refresh i_ad&1.
    clear i_ad&1.
    i_ad&1-&2 = &3.
    i_ad&1-updateflag = &6.
    i_ad&1-consnumber = &7.
    append i_ad&1.

    call function 'ADDR_COMM_MAINTAIN'
         exporting
              address_number                 = address_number
              language                       = sy-langu
              table_type                     = 'AD&1'
              substitute_all_comm_data       = &4
              accept_telnr_call              = ' '
              consider_consnumber_for_insert = &5
              check_address                  = 'X'
         tables
              comm_table                     = i_ad&1
              error_table                    = error_table
         exceptions
              parameter_error                = 1
              address_not_exist              = 2
              internal_error                 = 3
              others                         = 4.
    if sy-subrc <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
*         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    endif.
  END-OF-DEFINITION.

Then:

* ----------------------------------------------------------------------
* Fill structures and corresponding ITAB
* <Comm_Structure>-<Field_name> = <Value>
* ----------------------------------------------------------------------
  IF NOT telephone IS INITIAL.
    comm_maintain tel  tel_number telephone 'X' ' ' '' ''.
  ENDIF.

  IF NOT fax IS INITIAL.
    comm_maintain fax  fax_number fax 'X' ' ' '' ''.
  ENDIF.

  IF NOT teletex IS INITIAL.
    comm_maintain ttx  ttx_number teletex 'X' ' ' '' ''.
  ENDIF.

  IF NOT telex IS INITIAL.
    comm_maintain tlx  tlx_number telex 'X' ' ' '' ''.
  ENDIF.

  IF NOT email IS INITIAL.
    comm_maintain smtp smtp_addr  email 'X' ' ' '' ''.
  ENDIF.

  CALL FUNCTION 'ADDR_MEMORY_SAVE'
       EXCEPTIONS
            OTHERS = 1.
  IF sy-subrc <> 0.
    MESSAGE ID sy-msgid TYPE 'A' NUMBER sy-msgno
            WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
  ENDIF.

Oh yes... The internal tables:


  DATA: i_adtel like table of adtel with header line.
  DATA: i_adfax like table of adfax with header line.
  DATA: i_adttx like table of adttx with header line.
  DATA: i_adtlx like table of adtlx with header line.
  DATA: i_adsmtp like table of adsmtp with header line.

Former Member
0 Kudos
123

Hi,

try this BAPI_BUPA_ADDRESS_CHANGE

BAPI_BUPA_ADDRESS_ADD

Regards