on 2011 Mar 17 3:05 PM
Gurus
I am trying to use SLS_MISC_GET_LAST_DAY_OF_MONTH to get last day of the month, can you please advise me the syntax to use in user exit to call this FM ?
Thanks in advance
Hi there,
Her you go:
DATA ln_range LIKE LINE OF e_t_range.
DATA: g_l_per(3).
DATA: g_l_year(4).
DATA: l_date TYPE sy-datum.
DATA: l_last_day_date TYPE sy-datum.
* collects the last day of a date based on period ZANYVARWITHPERIOD of type FISCPER3 and year ZANYVARWITHYEAR
WHEN 'ZMYVAR'.
IF i_step = 2.
CLEAR ln_range.
CLEAR g_l_per.
CLEAR g_l_year.
CLEAR l_date.
CLEAR l_last_day_date.
ln_range-sign = 'I'.
ln_range-opt = 'EQ'.
LOOP AT i_t_var_range INTO ln_t_var_range
WHERE vnam = 'ZANYVARWITHPERIOD'.
g_l_per = ln_t_var_range-low.
EXIT.
ENDLOOP.
LOOP AT i_t_var_range INTO ln_t_var_range
WHERE vnam = 'ZANYVARWITHYEAR'.
g_l_year = ln_t_var_range-low.
EXIT.
ENDLOOP.
CONCATENATE g_l_year g_l_per+1(2) '01' INTO l_date. "first day of a date
CALL FUNCTION 'SLS_MISC_GET_LAST_DAY_OF_MONTH'
EXPORTING
DAY_IN = l_date
IMPORTING
LAST_DAY_OF_MONTH = l_last_day_date
EXCEPTIONS
DAY_IN_NOT_VALID = 1
OTHERS = 2.
ln_range-low = l_last_day_date.
APPEND ln_range TO e_t_range.
ENDIF.
Hope this helps,
Regards,
Diogo.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
70 | |
10 | |
10 | |
7 | |
6 | |
6 | |
6 | |
5 | |
5 | |
5 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.