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

Error FM

Former Member
0 Likes
2,085

Hi experts,

i have the following error when i launch my code, but i have no syntax error in my code.

The function call of SLS_MISC_GET_LAST_DAY_OF_MONTH failed; a field may have been assigned to the parameter DAY_IN whose"


Here is my program:


DATA: temp_date like sy-datum.

WHEN 'ZLASTDAYMONTH'.                

     if i_step = 2.

       LOOP AT I_T_VAR_RANGE INTO FISC_VAR_RANGE
             WHERE VNAM = 'ZTODAYDATE2'.

         CLEAR L_S_RANGE.

         call function'SLS_MISC_GET_LAST_DAY_OF_MONTH'
       exporting
         day_in = FISC_VAR_RANGE-LOW     "this is the user entry date based on ZTODAYDATE2
         importing
         last_day_of_month = temp_date.

         L_S_RANGE-LOW      = temp_date.
         L_S_RANGE-SIGN        = 'I'.
         L_S_RANGE-OPT         = 'BT'.
         APPEND L_S_RANGE TO E_T_RANGE.
         EXIT.
       ENDLOOP.
     endif.


Could you please tell me what's wrong with my program?


Thanks.


Amine


1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
2,016

Have you done any debugging to see the contents of variable fisc_var_range-low?

Also, in the code you have posted, there is no space between the CALL FUNCTION and the FM name.

Rob

Message was edited by: Rob Burbank

10 REPLIES 10
Read only

Former Member
0 Likes
2,017

Have you done any debugging to see the contents of variable fisc_var_range-low?

Also, in the code you have posted, there is no space between the CALL FUNCTION and the FM name.

Rob

Message was edited by: Rob Burbank

Read only

0 Likes
2,016

Hi Rob,

yes, it contains the system date 20150423.

no problem with the space, only a copy/past issue.

thanks.

Amine

Read only

0 Likes
2,016

Then what is the exact error you get?

Never mind - you have to make sure that the date is formatted correctly according to your user profile - like "23.04.2015".

Rob

Message was edited by: Rob Burbank

Read only

0 Likes
2,016

Rob,

it's a program developped in user exit in bw.

Here the screen shots with the real coding:

the error:

Read only

0 Likes
2,016

The type of parameter DAY_IN could be different from the type of FISC_VAR_RANGE-LOW.


Declare a date field with type same as DAY_IN, assign FISC_VAR_RANGE-LOW to newly declared field and pass the new field to the FM.

Read only

0 Likes
2,016

Well, the date still has the wrong format and you are not catching exceptions when calling the FM.

Rob

Read only

0 Likes
2,016

Hi Gajanan,

Your answer helped me, i have no more the first error, but the system tell me that there still an error;

here what i did:

i'v declared zdatein like sy-datum.

WHEN 'ZLASTDAYOFMONTH2'.

     IF i_step = 2  .

       READ TABLE i_t_var_range INTO loc_var_range WITH KEY vnam = 'ZTODAYDATE2'.

       zdatein = loc_var_range-low.

       CLEAR l_s_range.

      

       BREAK-POINT.

       CALL FUNCTION 'SLS_MISC_GET_LAST_DAY_OF_MONTH'

         EXPORTING

           day_in            = zdatein

         IMPORTING

           last_day_of_month = zdate.

      

       l_s_range-sign        = 'I'.

       l_s_range-opt         = 'BT'.

       l_s_range-low      = zdate.

       APPEND l_s_range TO e_t_range.

     ENDIF.


Thanks;


Amine

Read only

0 Likes
2,016

Your range is now incorrect.

You have to put zdatein in range-low and zdate in range-high if you are using the BT option.

Rob

Read only

0 Likes
2,016

What's the new error?

Read only

0 Likes
2,016

I made the same as you told me for import and export value.

everything is workinf fine.

Thanks guys.

Amine