‎2005 Oct 20 9:15 AM
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 !!!
‎2005 Oct 20 9:24 AM
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.
‎2005 Oct 20 9:22 AM
JUST GIVE A MESSAGE UNDER THE AT SELECTION-SCREEN AT <FIELDNAME>
SAYING RECORDS NOT FOUND.
REGARDS,
KARTIKEY.
‎2005 Oct 20 9:24 AM
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.
‎2005 Oct 20 9:36 AM
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.
‎2005 Oct 20 10:39 AM
Hi Shanmugam,
you can use a success message along with leave list processing.
MESSAGE s<msg no>.
LEAVE LIST-PROCESSING.
‎2005 Oct 20 9:30 AM
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.
‎2005 Oct 20 9:34 AM
hi,
try with this in start-of-selection
if sy-subrc <> 0.
message I001(zr).
endif.