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 Problem

Former Member
0 Likes
1,068

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

10 REPLIES 10
Read only

Former Member
0 Likes
959

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

Read only

Former Member
0 Likes
959

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

Read only

Former Member
0 Likes
959

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..

Read only

dev_parbutteea
Active Contributor
0 Likes
959

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.

Read only

antony_paul2
Active Participant
0 Likes
959

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

Read only

Former Member
0 Likes
959

Hi,

Try this...

if itab[] is initial.

message 'XXXXX' type 'I' as 'E'.

leave to screen 0.

endif.

Read only

Former Member
0 Likes
959

Hi,

You need to write this code under the event AT SELECTION SCREEN.

it will then return to selection screen.

-Raj

Read only

Former Member
0 Likes
959

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

Read only

0 Likes
959

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.

Read only

Former Member
0 Likes
959

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.