on 06-13-2022 8:44 PM
Hello Experts , I need a Customer exit to fetch data from 1st month of the year to Entered month (based on FISCPER)
For example - If I enter May I should get all the data from January to May
Currently this is the code I have written (Variable = ZVAR_FISCPER1)
Please help me with correct logic
DATA:
l_s_range TYPE rrrangesid,
loc_var_range LIKE rrrangeexit,
lv_month TYPE d,
lv_year(4) TYPE n,
lv_first_month TYPE sy-datum,
lv_last_month TYPE sy-datum.
*To Calculate First Month of the year
CASE i_vnam.
WHEN 'ZVAR_FISCPER1'.
IF i_step = 2.
LOOP AT i_t_var_range into loc_var_range WHERE vnam = 'ZVAR_FISCPER1'.
lv_month = loc_var_range-low+4(2).
lv_year = loc_var_range-low+0(4).
CONCATENATE lv_year '01' INTO lv_month.
CALL FUNCTION 'CACS_DATE_GET_YEAR_MONTH'
EXPORTING
day_in = lv_first_month
IMPORTING
last_month_of_year = lv_last_month.
l_s_range-low = lv_first_month.
l_s_range-high = lv_last_month.
l_s_range-sign = 'I'.
l_s_range-opt = 'BT'.
APPEND l_s_range TO e_t_range.
ENDLOOP.
ENDIF.
ENDCASE.
endmethod.
Hi Praveen,
Can you please check if this function module(CACS_DATE_GET_YEAR_MONTH) exist in your Bw environment ?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Hemanth, Yes that Function didn't exist in my system so I have changed the code to as follows
Please tell me if this code will suffice my requirement or not
DATA:endmethod.
User | Count |
---|---|
88 | |
10 | |
10 | |
9 | |
7 | |
7 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.