2015 Apr 23 3:15 PM
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
2015 Apr 23 3:17 PM
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
2015 Apr 23 3:17 PM
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
2015 Apr 23 3:27 PM
Hi Rob,
yes, it contains the system date 20150423.
no problem with the space, only a copy/past issue.
thanks.
Amine
2015 Apr 23 3:33 PM
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
2015 Apr 23 3:38 PM
Rob,
it's a program developped in user exit in bw.
Here the screen shots with the real coding:
the error:
2015 Apr 23 3:39 PM
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.
2015 Apr 23 3:45 PM
Well, the date still has the wrong format and you are not catching exceptions when calling the FM.
Rob
2015 Apr 23 3:54 PM
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
2015 Apr 23 4:00 PM
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
2015 Apr 23 4:01 PM
2015 Apr 23 4:44 PM
I made the same as you told me for import and export value.
everything is workinf fine.
Thanks guys.
Amine