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: 

address update function module based on adrnr

Former Member
0 Kudos

HI all,

I am facing issue with update adrc , adr6 table .

I have some data in z segment of vendor master in inbound idoc. i need to update this data into adrc , adr6 and tiban table .

i have seen threads for update vendor master data , ADDR_MAINTAIN_COMPLETE., ADDR_UPDATE, BAPI_BUPA_ADDRESS_CHANGE., but these are not satisfactory .

Any one can help with any FM which can do the work for me?

Regards,

Karan

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Thanks Michael and raymond for response .

I have managed to update many fields with FM ADDR_UPDATE ,but still did not found the way to update EMail address which resides in ADR6 table .

Can any one help in that?

Regards,

Karan

7 REPLIES 7

raymond_giuseppi
Active Contributor
0 Kudos

You coud also look at method VMD_EI_API=>MAINTAIN_BAPI (there are now some samples and threads on it in scn)

Regards,

Raymond

michael_kozlowski
Active Contributor
0 Kudos

check enhancement spot (tr. se18) VENDOR_ADD_DATA_BI and note

http://service.sap.com/sap/support/notes/580266

Former Member
0 Kudos

Thanks Michael and raymond for response .

I have managed to update many fields with FM ADDR_UPDATE ,but still did not found the way to update EMail address which resides in ADR6 table .

Can any one help in that?

Regards,

Karan

0 Kudos

Did you try  ADDR_COMM_MAINTAIN as it is being used in standard transaction like XK01/02 FK01/02.

Sample code which is working in my system.

DATA : itab TYPE STANDARD TABLE OF adsmtp.

DATA : error_table TYPE STANDARD TABLE OF addr_error.

DATA : wa_itab TYPE adsmtp.

DATA : g_address_handle TYPE ad_handle.

wa_itab-consnumber = '001'. "Sequencial number 3 char

wa_itab-smtp_addr = 'test@gmail.com'.

wa_itab-smtp_srch = wa_itab-smtp_addr(20).

TRANSLATE wa_itab-smtp_srch TO UPPER CASE.

wa_itab-flgdefault = 'X'. "abap_true.

wa_itab-updateflag = 'U'. "I'nsert, 'U'pdate, 'D'elete

wa_itab-home_flag = 'X'.

APPEND wa_itab TO itab.

CALL FUNCTION 'ADDR_COMM_MAINTAIN'

   EXPORTING

     address_handle     = g_address_handle

     address_number     = '0000047056'

     table_type         = 'ADSMTP'

     iv_time_dependence = 'X' "abap_true'

   TABLES

     comm_table         = itab

     error_table        = error_table

   EXCEPTIONS

     parameter_error    = 1

     address_not_exist  = 2

     internal_error     = 3

     OTHERS             = 4.

IF sy-subrc <> 0.

   LEAVE PROGRAM.

*         MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

*               WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

ENDIF.

CALL FUNCTION 'ADDR_MEMORY_SAVE'

* EXPORTING

*   EXECUTE_IN_UPDATE_TASK       = ' ' "You may want set this flag as 'X' if you are calling                                                                       "from BADI/UserExit or Idoc even based on reqmnt

  EXCEPTIONS

    ADDRESS_NUMBER_MISSING       = 1

    PERSON_NUMBER_MISSING        = 2

    INTERNAL_ERROR               = 3

    DATABASE_ERROR               = 4

    REFERENCE_MISSING            = 5

    OTHERS                       = 6

           .

IF sy-subrc <> 0.

* Implement suitable error handling here

ENDIF.

0 Kudos

HI rudra ,

Thank for your reply .

I think it should work , but when i implemented this FM in my exit ,  i got field consnumber in error table . not able to find use of this.

DO you have any idea?

Regards,

Karan

0 Kudos

It is just a 3 digit sequential number. Check table ADR6.

So when you want to update/Delete ( Flag "U"/"D" ) you have pass that correctly(Should be existing in ADR6) in the comm_table. When you use Insert ( "I") it should not be existing in ADR6.

0 Kudos

Thanks alot Rudra ..

it is working like butter...