Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

Validations In selection Screen

Former Member
0 Kudos

Hi Experts ,

In the selection screen i want to give a information message if the user enters wrong text and the it should not go to the output screen. It should come back to the selection screen.

Note : i want to use Information message.

Correct Answers will be appriciated with good points.

Regards,

Sunita.

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Hi,

Check this out..

AT SELECTION-SCREEN .

If condition.

Message I001(message id) .

Stop. <-- U can use Exit too

LEAVE LIST-PROCESSING.

Endif.

Revert back if any issues.

Regards

Naveen

8 REPLIES 8

former_member195383
Active Contributor
0 Kudos

IF <put the codition>.

MESSAGE.

ENDIF.

in the message put an information message...like

IF pa_rpath IS INITIAL.

MESSAGE i999(message class) WITH text-016 .

endDIF.

in the text element u can write ur required message

Edited by: Rudra Prasanna Mohapatra on Jul 3, 2008 7:07 AM

Edited by: Rudra Prasanna Mohapatra on Jul 3, 2008 7:08 AM

Edited by: Rudra Prasanna Mohapatra on Jul 3, 2008 7:08 AM

Former Member
0 Kudos

Hi sunetha,

u can use the message class for the error display.

or

in the selection screen u can the parameter or selectoption as obligatery .

then it will display error

former_member784222
Active Participant
0 Kudos

In that case do the validation inside START-OF-SELECTION.

If validation fails give and information message and use key word EXIT to come to the selection screen.

PARAMETERS: P_TEST(10) TYPE C.

START-OF-SELECTION.

IF P_TEST NE 'XYZ'.

MESSAGE 'Please enter valid value' type 'I'.

exit.

ENDIF.

other selections.

regards,

Mouli.

nikhil_chitre
Active Participant
0 Kudos

Hi

you will have to make use of Statement AT SELECTION-SCREEN

Have a look at below code for Reference

SELECTION-SCREEN BEGIN OF SCREEN 500.

SELECT-OPTIONS s_conn FOR sflight_wa-connid.

DATA s_conn_wa LIKE LINE OF s_conn.

SELECTION-SCREEN END OF SCREEN 500.

  • Handling selection screen events

AT SELECTION-SCREEN ON p_carrid.

IF p_carrid IS INITIAL.

MESSAGE 'Please enter a value' TYPE 'E'.

ENDIF.

AUTHORITY-CHECK OBJECT 'S_CARRID'

ID 'CARRID' FIELD p_carrid

ID 'ACTVT' FIELD '03'.

Regards,

Nikhil

former_member654348
Participant
0 Kudos

HI

Create a message class and place the information message u want to display in that message class.

use that in your program

in the AT selection screen event, check for the input entered,

if that is not corret, display dat message and exit.

Former Member
0 Kudos

Hi ,

For validation in selection screen:

Suppose you are having vbeln in selection screen as s_vbeln.

select-options:s_vbeln for vbap-vbeln.

Now you have to validate s_vbeln.

data : l_vbeln type vbap-vbeln.

select single vbeln

from vbap into l_vbeln

where vbeln in s_vbeln.

if sy-subrc ne 0.

message I001. "Enter correct no.

endif.

Rgds.

sachin_mathapati
Contributor
0 Kudos

Hi Sunita,

Raise a warning message and use Leave List processing.

AT SELECTION-SCREEN .

If condition.

Message Woo1(message id) .

LEAVE LIST-PROCESSING.

Endif.

Reward If helpful.

Regards,

Sachin M M

Former Member
0 Kudos

Hi,

Check this out..

AT SELECTION-SCREEN .

If condition.

Message I001(message id) .

Stop. <-- U can use Exit too

LEAVE LIST-PROCESSING.

Endif.

Revert back if any issues.

Regards

Naveen