Is it possible through a message in selection screen for a query
I got requirement like need to through a message,
Let us say, while running the query date characterstic has created a variable with multiple selections.
User can give From Date to To Date, I need to through a message if " From Date to To Date" is more than 7 days. You have selected more than 7 days like that message.
If possible what is the neccessary code to write in exit in order to populate the message.
Could you please provide me the information regarding the same.
thanks for your support.
Pradeep Errapothu replied
Data : l_begin_date TYPE d,
l_end_date TYPE d,
l_duration TYPE i,
wa_range TYPE rrs0_s_var_range.
IF I_STEP = 3 .
Read table I_T_VAR_RANGE INTO wa_range with key VNAM = 'variable'.
If sy-subrc = 0.
l_begin_date = wa_range-low.
l_end_date = wa_range-high.
CALL FUNCTION 'DAYS_BETWEEN_TWO_DATES'
i_datum_bis = l_end_date
i_datum_von = l_begin_date
e_tage = l_duration.
If l_duration GE 7.
L_MSGV1='User has to select only period for 7 days '.
CALL FUNCTION 'RRMS_MESSAGE_HANDLING'
I_CLASS = 'RSBBS'
I_TYPE = 'E'
I_NUMBER = '000'
I_MSGV1 = ' L_MSGV1'
DUMMY = 0
OTHERS = 0.
SY-SUBRC = 4.
When user enters more than 7 days, a pop up comes telling him not to enter more than 7 days.
Please note i didn't test the code, check code for any syntax error.
Hope this helps..