Application Development and Automation 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: 
Read only

Function Module ADDR_GET error

Former Member
0 Likes
2,536

Hello experts,

I have a problem regarding the usage of the function module ADDR_GET. After execution of this FM, I get the subrc 0 but an error. In the error_table I get an entry with MSG_ID = AM, MSG_TYPE = E, MSG_NUMBER = 873. The FM 'MESSAGE_PREPARE' gives me the text "Date ' ' is not valid".

I already checked the date which i input into the FM, this is correct. The DATE_FROM in the database table ADRC is filled in this entry with 01.01.0001. Could this be the problem, as low_date is usually 01.01.1800?

Thanks in advance for your help

Alex

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
2,061

Hi Alex,

Pass the ADDRESS_SELECTION-DATE = '00010101',You will get the data.If you use any other date other than this  you will get the same problem. Strange but check the code line 139 of pgm LSZA0F21.

Or else, just dont pass the date while calling the FM, you will get the values in SADR and date details in versions table.

Thanks.

11 REPLIES 11
Read only

Former Member
0 Likes
2,061

Hi

Have you checked the date format?

Max

Read only

0 Likes
2,061

Yes, I am passing SY-DATUM.

Read only

Former Member
0 Likes
2,061

I tried passing a valid address number with leading zeroes, and date in YYYYMMDD format. (00010101 in your case), and call was successful.

Read only

0 Likes
2,061

Can you provide sample code please?

Read only

0 Likes
2,061

The FM documentation says that address date field is not supported. This is the reason why call works for blank date or 00010101 date, and not for sy-datum.

The parameter DATE is for time dependency. It is not currently supported. The parameter does not show a validity date for which the address is to be read. If the parameter is filled with a value other than '00000000' (initial value for date field)  or '00010101' (currently the only possible database key), an error is returned in ERROR_TABLE (return code 'E').

Here is a sample code.

DATA v_address_selection        TYPE addr1_sel.
DATA v_sadr                     TYPE sadr.

v_address_selection-addrnumber = '0000098765'.
*v_address_selection-date = sy-datum.
CALL FUNCTION 'ADDR_GET'
   EXPORTING
     address_selection = v_address_selection
   IMPORTING
     sadr              = v_sadr
   EXCEPTIONS
     OTHERS            = 1.

Read only

0 Likes
2,061

Thanks

Read only

former_member188827
Active Contributor
0 Likes
2,061

Please share the format in which you are passing the date. It should be in "YYYYMMDD" format.

Regards

Read only

0 Likes
2,061

I am passing SY-DATUM, so the format of the date is correct.

Read only

0 Likes
2,061

Could please paste the screen shot of data being passed to FM plus the data in database table which you are expecting.

Read only

Former Member
0 Likes
2,062

Hi Alex,

Pass the ADDRESS_SELECTION-DATE = '00010101',You will get the data.If you use any other date other than this  you will get the same problem. Strange but check the code line 139 of pgm LSZA0F21.

Or else, just dont pass the date while calling the FM, you will get the values in SADR and date details in versions table.

Thanks.

Read only

0 Likes
2,061

Thanks