cancel
Showing results for 
Search instead for 
Did you mean: 

Return to selection if no records found

Former Member
0 Kudos

Hello,

I am fetching data based on some criteria but if no records found, how to return to again selection screen with displaying message?

I have tried with sy-subrc & itab[] not initial but it is not working.

Here after selecting data I am displaying it into a table control. If no records selected it is displaying the table control screen.

Regards,

Dilip

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi,

if you want to return back to the selection screen if selection fails,

1) you have to keep this select in at selection screen event. so that if no data found, you can give error message and the program will not proceed further and just shws your selection screen with error message.

2) if this select is inside start-of-selection event, then you have to stop the program giving a status message. (better flag a value here so that you can skiop end-of-selection code also if anything is there.

regards,

sundaram

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi,

if u are using message type 'E' to display an error messag and then want to get back to selection screen do something like this.

If <no-data>

message 'no data found' type 'E' display like 'S'.

leave list-processing.

endif.

I am assuming that u are coding this in start-of-selection event, and no processing is done in END-of-selection.

Hope this helps.