‎2011 Mar 03 4:02 PM
Hello,
I have a selection screen 1000, and a result screen 200 with ALV (but the issue is there even if I don't render it).
I do some processing in screen 1000, and then CALL SCREEN 200. then display results in the ALV.
I coded the PAI with LEAVE TO SCREEN 0 on BACK.
Everything works when I do not use COMMIT WORK Statement in end-of-selection of screen 1000.
But when I do use COMMIT WORK, then I have to click twice to go back from screen 200 to selection screen. After the first click on BACK the selection screen 200 is displayed again, though the Title of the screen changes from mine to SAP, that'd mean that PBO modules of screen 200 are not called the second time (as I can see in debug), but the screen is still there until I click the back button again.
Any help appreciated,
Michal
‎2011 Mar 03 4:07 PM
‎2011 Mar 03 4:09 PM
Not really, but the issue remains even if I leave the whole logic in start-of-selection.
‎2011 Mar 03 4:14 PM
Can you paste your code here for PAI (200) and th epoint where you call 200 and Commit work .
‎2011 Mar 03 4:19 PM
Commit is in a loop
FORM commit CHANGING cs_data TYPE ty_data.
DATA: lt_return TYPE TABLE OF bapiret2.
CALL FUNCTION 'BAPI_CPROJECTS_COMMIT_WORK'
TABLES
return = lt_return.
PERFORM check_results USING lt_return
CHANGING cs_data-error.
ENDFORM.after that I do the call:
CALL SCREEN 200.THE PAI:
MODULE user_command_0200 INPUT.
DATA: lv_okcode TYPE sy-ucomm.
lv_okcode = okcode.
CLEAR okcode.
CASE lv_okcode.
WHEN 'EXIT'.
LEAVE PROGRAM.
WHEN 'CANCEL'.
LEAVE TO SCREEN 0.
WHEN OTHERS.
LEAVE TO SCREEN 0.
ENDCASE.
ENDMODULE.
‎2011 Mar 03 4:23 PM
Well this looks ok to me ... another tyr will be to check if you had set a default screen number for screen 200.
‎2011 Mar 03 4:31 PM
If you mean Next Screen attribute in the Attributes tab of the screen, then it doesn't matter what's in there, 1000, 200 or nothing. Issue remains.
‎2011 Mar 03 4:31 PM
From the F1 help for LEAVE TO SCREEN:
This statement must not be used when handling events of the Control Framework.
Rob
‎2011 Mar 03 4:34 PM
The same thing happens if I use SET SCREEN 0. LEAVE SCREEN.
Any other way to navigate back to selection screen?
‎2011 Mar 03 4:56 PM
What I have done is :
call method cl_gui_cfw=>dispatch.
CALL METHOD grid1->free.
LEAVE TO SCREEN 0.Rob
‎2011 Mar 04 10:14 AM
After applying your correction the ALV grid disappeared - the screen is blank, and it still is screen 200, and the title is 'SAP' instead of my own.