10-23-2007 11:45 AM
Hi fnds,
I have Z program which will give us an ALV report. I set a custom PF status to the report.
I handle the custom PF for exit by using LEAVE TO SCREEN 0.
Problem is that.
Once i execute the report its giving ALV. if i press BACK its giveing selectoin screen.But if i press BACK in the selection screen its again going to ALV report which should not. it should go ABAP editor.
Please let me know asap.
10-23-2007 11:58 AM
Try to include this in PAI on each screen. THIS SHOLD BE THE FIRST STATEMENT ON EVERY SCREEN,IN PAI PART.
Module EXIT_BACK ON EXIT-COMMAND.
here the code for the same.
Module EXIT_BACK INPUT.
CASE OK-CODE.
WHEN 'BACK'.
LEAVE TO SCREEN 0.
WHEN 'EXIT'.
LEAVE PROGRAM.
ENDCASE.
ENDMODULE.
ALSO IN YOUR PF-STATUS.
DOUBLE CLICK YOUR BACK BUTTON AND EXIT BUTTON.
SELECT 'E' FOR THEM ON EACH SCREEN.
SAVE AND ACTIVATE
NOW RUN.
REWARD IF USEFUL.
AMIT SINGLA
Message was edited by:
Amit Singla
10-23-2007 12:02 PM
In user-command, check the screen no before coding for BACK. like:
case sy-ucomm.
when 'BACK'.
IF sy-dynnr EQ '0100'.
leave to screen 0.
elseif sy-dynnr EQ '1000'.
leave program.
endif.
endcase.
10-23-2007 12:11 PM
Hi
You can check the value for sy-ucomm if it is equal to the function code of back button then use leave list processing,I think it will take back to your selection screen.
Reward if useful
Regards
Shibin