Application Development and Automation 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: 
Read only

Validations In selection Screen

Former Member
0 Likes
1,193

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
Read only

Former Member
0 Likes
1,091

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
Read only

former_member195383
Active Contributor
0 Likes
1,091

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

Read only

Former Member
0 Likes
1,091

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

Read only

former_member784222
Active Participant
0 Likes
1,091

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.

Read only

nikhil_chitre
Active Participant
0 Likes
1,091

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

Read only

former_member654348
Participant
0 Likes
1,091

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.

Read only

Former Member
0 Likes
1,091

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.

Read only

sachin_mathapati
Contributor
0 Likes
1,091

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

Read only

Former Member
0 Likes
1,092

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