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.
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.
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.
message 'no data found' type 'E' display like 'S'.
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.