Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

PF Status

Former Member
0 Kudos

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.

3 REPLIES 3

Former Member
0 Kudos

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

Former Member
0 Kudos

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.

Former Member
0 Kudos

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