Hi Sarath,
Hope you are doing well.
I assume you are using BEx for this requirement?
This is possible by using the customer exit for the variables.
One thing to keep mind of is the step (I_STEP in the code) or level at which the exit code will run. In your case, this should be I_STEP = 2.
I assume you want the customer to always see only 1 input field (for calendar/month) and not a range.
Then you need 2 variables, both belonging to the infoobject (0CALMONTH)
1 variable should be user entry, ready for input, and a single value. Say this is ZV_CALMO_INP
The 2nd variable should be hidden (not ready for input), customer exit and interval. Say this is ZV_CALMO
The code should look something like this:
.
.
DATA: L_S_RANGE TYPE RSR_S_RANGESID,
LOC_VAR_RANGE LIKE RRANGEEXIT.
.
IF I_STEP = 2.
CASE I_VNAM.
WHEN 'ZV_CALMO'.
LOOP AT i_t_var_range INTO loc_var_range WHERE vnam = 'ZV_CALMO_INP'. "This line is to look for the user input variable
clear: l_s_range.
IF loc_var_range-low IS NOT INITIAL.
"If the input variable is maintained, derive the range.
"l_s_range-low will contain the first month of the year,
"while l_s_range-high will contain the user input.
l_s_range-sign = 'I'.
l_s_range-opt = 'BT'.
CONCATENATE loc_var_range-low(4) '01' INTO l_s_range-low.
"l_s_range-low = .
l_s_range-high = loc_var_range-low.
ENDIF.
APPEND l_s_range TO e_t_range.
ENDLOOP.
.
.
ENDCASE.
ENDIF.
.
.
Good luck with this!
Add comment