‎2008 Dec 23 3:35 AM
Hi Experts,
I have one query. My requirement is that based on selection screen input, If I don't find any data then I wanted to display an error message & come back to my selection screen.
I wrote the logic as
If ITAB[] IS NOT INITIAL.
MESSAGE E000 WITH TEXT-M01.
ENDIF.
But It is not coming back to my selection screen. Any suggestion how I can achieve the requirement?
Regards,
Poonam
‎2008 Dec 23 3:38 AM
Hi
If you dont find any data then you need write the IF condition
if itab[] is initial.
message 'No data found' type 'E'.
leave to screen 0.
endif.
Best Regards
Ramchander Rao.K
‎2008 Dec 23 3:56 AM
Hi
If you have written code in at selection screen use Leave list-processing.
If ITAB[] IS NOT INITIAL.
MESSAGE E000 WITH TEXT-M01.
Leave list-processing.
ENDIF
Shiva
‎2008 Dec 23 3:57 AM
Hi,
Do this way...
at selection-screen on p_file. u201Cp_file is parameter on selection-screen
*---checking file exist or not in AS
put you select query here.....
If ITAB[] IS NOT INITIAL.
MESSAGE E000 WITH TEXT-M01.
ENDIF.
Thanks & Regards,
Krishna..
‎2008 Dec 23 3:58 AM
Hi,
- in START-OF-SELECTION
event do your data retrievals,
select *
from table.
if sy-subrc <> 0.
stop.
endif.
- in END-OF-SELECTION event
If ITAB[] IS NOT INITIAL.
MESSAGE s000 WITH TEXT-M01.
ENDIF.
You should display am information message since no errors were found but data entered in selection screen is valid. Its just that no valid data was retrieved from database.
Regards,
Dev.
‎2008 Dec 23 4:28 AM
Hi,
You need to check for data at AT SELECTION-SCREEN event. While processing START-OF-SELECTION you can never go back to your selection screen by throwing an error message.
Regards,
Antony
‎2008 Dec 23 4:47 AM
Hi,
Try this...
if itab[] is initial.
message 'XXXXX' type 'I' as 'E'.
leave to screen 0.
endif.
‎2008 Dec 23 5:14 AM
Hi,
You need to write this code under the event AT SELECTION SCREEN.
it will then return to selection screen.
-Raj
‎2008 Dec 23 5:16 AM
Hi
You can try it like this
if itab[] is initial.
MESSAGE 'PLEASE CHECK THE ENTRY' TYPE 'E'.
else.
Message----
.
you wont to exit the selection screen when there is no match fir ur perticular condition hence its better if you use ita[] is initial.
hence whenever there is no match fr the particular condition it will give u this message
regards
sumeet malhotra
‎2008 Dec 23 5:26 AM
Hi,
U cant come back to the selection screen if u are passing the error message .
U need to write as follow.
If not itab[] is initial.
Message text-001 type 'I'.
Leave List-processing.
endif.
This will definately work.
Regards,
Naresh.
‎2008 Dec 23 5:21 AM
Hi,
try this
at selection-screen on s_bukrs (Ur screen input).
select single bukrs from t001 into it_t00l where bukrs in s_bukrs.( Ur selection )
if sy-subrc <> 0.
message E000 with text-001.
exit.
endif.
it will work for requirement.