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

Selection Screen

Murali_Shanmu
SAP Champion
SAP Champion
0 Likes
692

Hi

I have a set of fields in my selection screen. I have validated all the fields using "AT Selection-Screen on <FieldName>"

Now my problem is that during "START-OF-SELECTION" i am trying to fetch records for the given criteria in Selection Screen.If there r no records, i have to put the user back to the selection screen with a message.

I am not able to do this.

I tried using "Leave to screen 0" and also "Leave to List-Processing" in end of "START-OF-SELCTION" block.

Can anyone correct me here !!!

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
672

Hi

You can try to use the command STOP

START-OF-SELECTION.

SELECT * FROM TABLE WHERE ... IN SEL_OPT

ENDSELECT.

IF SY-SUBRC <> 0.

MESSAGE I..... WITH 'NO DATA'.

STOP.

ENDIF.

6 REPLIES 6
Read only

Former Member
0 Likes
672

JUST GIVE A MESSAGE UNDER THE AT SELECTION-SCREEN AT <FIELDNAME>

SAYING RECORDS NOT FOUND.

REGARDS,

KARTIKEY.

Read only

Former Member
0 Likes
673

Hi

You can try to use the command STOP

START-OF-SELECTION.

SELECT * FROM TABLE WHERE ... IN SEL_OPT

ENDSELECT.

IF SY-SUBRC <> 0.

MESSAGE I..... WITH 'NO DATA'.

STOP.

ENDIF.

Read only

0 Likes
672

Thanks max bianchi. It worked.

Hi Ruthra, i need to do this after the START-OF-SELECTION. I am also using "AT Selection-screen on <Field>" for preliminary checks.

Thanks anyway.

Read only

0 Likes
672

Hi Shanmugam,

you can use a success message along with leave list processing.

MESSAGE s<msg no>.

LEAVE LIST-PROCESSING.

Read only

Former Member
0 Likes
672

Hi,

Try this,

REPORT EVENT_DEMO.

AT SELECTION-SCREEN ON CITY_FR.

IF CARRID-LOW EQ 'AA' AND CITY_FR NE 'NEW YORK'.

MESSAGE E010(HB).

ENDIF.

Also check this,

<u>http://help.sap.com/saphelp_erp2004/helpdata/en/79/34a237d9b511d1950e0000e8353423/frameset.htm</u>

Kindly reward points if u find it useful.

Thanks&Regards,

Ruthra.

Read only

Former Member
0 Likes
672

hi,

try with this in start-of-selection

if sy-subrc <> 0.

message I001(zr).

endif.