Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

Is it possible through a message in selection screen for a query

Hi,

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.

Former Member
Former Member replied

Data : l_begin_date TYPE d,

l_end_date TYPE d,

l_duration TYPE i,

wa_range TYPE rrs0_s_var_range.

Case i_vnam.

when 'Variable'.

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'

EXPORTING

i_datum_bis = l_end_date

i_datum_von = l_begin_date

IMPORTING

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'

EXPORTING

I_CLASS = 'RSBBS'

I_TYPE = 'E'

I_NUMBER = '000'

I_MSGV1 = ' L_MSGV1'

EXCEPTIONS

DUMMY = 0

OTHERS = 0.

RAISE NO_PROCESSING.

SY-SUBRC = 4.

endif.

endif.

endif.

endcase.

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..

/Pradeep

0 View this answer in context

Helpful Answer

by
Not what you were looking for? View more on this topic or Ask a question