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: 

Unable to update ADRT table

Former Member
0 Kudos

Hi experts,

I am trying to update the REMARK field of the table ADRT using Function module  ADDR_REMARKS_MAINTAIN.

After this Function module I am calling the  ADDR_MEMORY_SAVE FM also. But the data is still not reflecting in the Database.

For your reference:-

The ADRT table contents:-

The values used while calling the FM are:-

COMM_REMARKS table:-

What could be the problem? Please advice.

Thanks.

16 REPLIES 16

former_member187748
Active Contributor
0 Kudos

Hi Arshdeep,

please debug your function module and see, what are you getting in RETURN parameter in ADDR_REMARKS_MAINTAIN

0 Kudos

Hi Sanjeev - Thanks for your response!

The RETURN parameter is empty, please see below.

0 Kudos

Hi ,

did you passed the address number with leading zero, please check it once. See what is in  comm_remarks_out

0 Kudos

what is contained by COMM_REMARKS and COMM_REMARKS_OUT?

0 Kudos

Hi Sanjeev,

Comm_remarks_out contains the exact same information as COMM_REMARKS.

(as shown in the screenshot above)

Thanks.

0 Kudos

Hi Sander,

Thanks for your response!

I have provided a screenshot above that shows COMM_REMARKS contents.

COMM_REMARKS_OUT is empty initially.

After I run the Function module, COMM_REMARKS_OUT contains the same information as of COMM_REMARKS.

Thanks.

0 Kudos

And yes, I passed the ADRNR with leading zeros. The system automatically truncates them.

0 Kudos

Hi ,

Please do as suggested by Raymond, it will solve your issue.

0 Kudos

And what do they contain when the function module is executed?

BTW, is the address valid on 01.01.0001?

That's a very old address

raymond_giuseppi
Active Contributor
0 Kudos

Did you try to use some class like VMD_EI_API or CMD_EI_API method MAINTAIN_BAPI ?

Regards,

Raymond

0 Kudos

Hi Raymond,

Thanks for your response!

Will do try the same.

But why these FMs are not working? any idea on this?

Thanks a lot!

0 Kudos

Those not released FM are not documented for us customers to use, so beware upgrade projects.

You could conceivably perform some where-used search on those to find how standard reports call them (e.g. report RJGADR20, FM ADDR_MAINTAIN_COMPLETE) but using an "official" tool would be far less risky.

Regards,

Raymond

Former Member
0 Kudos

Hi Arashdeep,

I have the same requirement , to update this field REMARK for customer using ABAP code.

Can you please help me ?

How did you get success ?

Thank you !

Harish Bhatt

0 Kudos

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

Former Member
0 Kudos

This FM ADDR_REMARKS_MAINTAIN is not designed for insert  remark field in ADRT table.

Former Member
0 Kudos

Instead 'U' in updateflag field, put 'X'.

after call ' ADDR_MEMORY_SAVE'

                  ' ADDR_MEMORY_CLEAR'

It works 

Regards