2012 Jul 19 9:26 AM
Hello ,
I have an issue with program flow in selection screen rapport. In my perform "get _data i have several checks after select statements .
At the last one ( below) when sy-subrc = 4 i have pop up ( info ) saying that data was not found. After change of select criteria hiting the enter "at select screen" event is trigered and program executes performs below end-of selection ( jumping over start of selection ) .
I do not understand why perform get data is not executed after the message were displayed.
please advice
Chris
IF sy-subrc = 0.
SELECT changenr udate FROM cdhdr
INTO CORRESPONDING FIELDS OF TABLE i_change
FOR ALL ENTRIES IN i_cdpos
WHERE objectid EQ i_cdpos-objectid AND
objectclas EQ i_cdpos-objectclas AND
changenr EQ i_cdpos-changenr.
ELSE.
MESSAGE ID '/BDL/TASKMANAGER' TYPE 'I' NUMBER '102'.
CALL SELECTION-SCREEN 1000 .
INITIALIZATION.
PERFORM clear.
PERFORM set_up_doc_type.
PERFORM set_ranges.
g_repid = sy-repid.
PERFORM fld_cat USING it_fcat.
PERFORM build_eve. " hot spot detail tbl
PERFORM built_eve1. " call trx
at selection-screen.
perform validate_fy.
START-OF-SELECTION.
PERFORM get_data.
END-OF-SELECTION.
PERFORM calculate_no_of_days.
PERFORM build_layout.
PERFORM display_data.
2012 Jul 19 10:02 AM
HI,
Instead of using the statement call selection screen 1000.
try using LEAVE TO SCREEN 0 & try, let me know...
2012 Jul 19 9:30 AM
Hi,
When the user press enter on selection screen, the events at selection-screen & at selection-screen output are triggered.Statements between start-of-selection and end-of-selection are executed when user press F8 to execute the report.
I'm not very sure If I have understand correctly your problem.
2012 Jul 19 10:04 AM
Hi ,
The problem comes when after one of selectst data were not found and the error message is displayed. ( please see the firs part of the code .This query is in perform grt data )
So data were not found , Info pop up is displayed and user hits enter ( upon message display) , changes data on selection screen and than flow goes on again trough at- selection screen ( which is ok ) but when start of selectio has to be executed , program jumps over it and goes directly to performs below end of selection.
I would expect, after mesage ( no data selected) was displayed and user has change entry on selection screen , that program goes to get_data perform and try to retrieve data with once more with new criteria.
Thanks
2012 Jul 19 10:02 AM
HI,
Instead of using the statement call selection screen 1000.
try using LEAVE TO SCREEN 0 & try, let me know...
2012 Jul 19 10:11 AM
Hi ,
The statement leave to screen 0 exits the program. This is not what I am looking for . After eror message displays tah dat were not found , i need to get back to select screen where user will change
criteria hit F8 and the program executes again.
2012 Jul 19 10:19 AM
Hi again,
Let me propose you something.
Change the get_data routine and add a changing parameter.
Mark the parameter with X if selection is succesfull or space if selection is invalid.
Then, check the parameters value to see if you will go on on the display of the records or issue the message.
Call selection screen is not needed in this case.
Try it and let me know.
Regards.
perform get_data changing success.
END-OF-SELECTION.
if success = 'X'.
PERFORM calculate_no_of_days.
PERFORM build_layout.
PERFORM display_data.
else.
message i999(xx) with......
endif.
2012 Jul 19 10:24 AM
Use LEAVE LIST-PROCESSING after the message and check.
Thanks,
Shambu
2012 Jul 19 10:32 AM
2012 Jul 19 10:43 AM
Hiiii,
Just write - leave to current transaction after your message.