cancel
Showing results for 
Search instead for 
Did you mean: 

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

Former Member
0 Kudos

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.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos
Former Member
0 Kudos

Hi Andre,

Thank You Very Much for your quick response.

I'm aware of I_STEP =3, where we can validate the user input data. But I'm not sure we can raise pop-up saying that you entered wrong values.

Could you please provide me the code for the following.

I've range date field i.e From and To Values. User has to select only period for 7 days. Let us say if selects April 1st 2009 to April 15th 2009.Then I need to raise pop-up like "You have entered more than 7 days, Please enter period 7 days only" like that.

I'll assign full points for this.

pradeepe-07
Explorer
0 Kudos

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

Former Member
0 Kudos

Hi Pradeep,

Thank You Very Much for your quick response.

I'll check the code and assign full points to you.

Once again thanks for your support.

Former Member
0 Kudos

Hi Pradeep,

once agian thank you very much for your support.

I've assigned full points.

Former Member
0 Kudos

Hi,

I followed your steps and It is not throughing any error message even if user enters more 7 days.

Query is executing and results are coming even user enters more no of days. I'm just wondering why pop-up message is not coming.

Could you please through a light on this.

Regards,

Sekhar.

Answers (2)

Answers (2)

Former Member
0 Kudos
Former Member
0 Kudos

Hello,

yes you can. You can use the step 3 in the customer exit (cmod) for analyzing the entered user data.

Buy,

André