‎2008 Jan 11 11:54 AM
High Experts,
may this has been postet here in former times, but here's my problem: we use to change from abap to abap-objects. Now i have a simple SELECTION-SCREEN and until now i used the AT SELECTION-SCREEN-statement and an MESSAGE TYPE 'E' to return to this screen if there is now recordset found. So i don't want to validate the values of the screen, i want to start my main-method, gather all the informatin i need and then, when there is no recordset, i want to leave this method and start at the selection-screen. i can not use AT SELECTION... inside my method because this is a break in my method. If i use it outside i can not react on sy-subrc inside the method.
Can anyone help me?
Thanks a lot, Harry
‎2008 Jan 11 12:25 PM
Hi,
As per my understanding you want to gather all the informations and then you are looking for validation.
If you are gathering all the information based on the selection criteria then doing this is absolutely wrong. Because getting all the info based on the selection crieria [Without validating] and then finally checking the input data does not make sense.
So definitely you need to validate the data first of all.
If this is not be the case and you just to doing something before the selection data is coming to your program then you have to call a method at the INITIALIZATION stage and prepare the environment. After that simply AT SELECTION-SCREEN and validate the input values.
So for validating plant [as an e.g.] create a static method for validating plant and call the method at the AT SELECTION-SCREEN event and give error message and simply LEAVE LIST-PROCESSING.
Hope I haven't confused you
Cheers
Somnath
‎2008 Jan 11 12:44 PM
Hello Somnath,
the problem is that all the values are validatet. Then, when they are validatet, i call a method and inside this method i gather information for something, let's say a alv. At this time i left the selection-screen and startet working. i do some selects on tables and now, if there is no recordset (sy-subrc <> 0) i want to break working, show a message at the statusbar and go back to the selection-screen without leaving the program and restart it. until this day i did this with the at selection-screen on blockxxx command. If there was no recordset i raised a message with type 'E' on which the at selection-screen command was listening and went back to my selection-screen (which still had the values i entered before). And this is what i wish to to inside my method.
Greetings, Harry
‎2008 Jan 11 12:50 PM
high Somnath,
now i know what to do:
CLASS clBfJahr DEFINTION.
....
....
CLASS clBfJahr IMPLEMENTATION.
...
...
AT SELECTION-SCREEN ON BLOCK blocka.
clBfJahr=>main( ).
START-OF-SELECTION.
Thanks a lot, Harry