Skip to Content
author's profile photo Former Member
Former Member

Ho to back on selection screen using BACK button

Salute.

I have a program which contains 3 screens:

1st -- selection screen.

2nd -- my screen, I called it 1002, When I press F8 button on I get on it. I am using cl_gui_alv_grid there with my own buttons. So when I press MY OWN the save button I get the 3d screen

3d -- my own screen with some labels (screen name 1001).

So when i press BACK button on the third screen I want to back on selection screen and skip second screen, but I can't, I think the problem is in the cl_gui_alv_grid because I use custom grid handler:

METHOD handle_user_command.

DATA :

ls_selected TYPE lvc_s_roid,

lt_selected TYPE lvc_t_roid.

CASE e_ucomm.

WHEN 'QSAVE'.

PERFORM save_data.

CALL SCREEN 1001.

WHEN OTHERS.

ENDCASE.

ENDMETHOD. "handle_user_command

Thank You.

Edited by: kernel.panic on Nov 24, 2009 6:31 AM

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

9 Answers

  • Best Answer
    author's profile photo Former Member
    Former Member
    Posted on Nov 24, 2009 at 08:11 AM

    Hi,

    Did you program for the BACK button on the selection screen?

    You can find the PBO and PAI for the selection screen.

    Code for your button there.

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Nov 30, 2009 at 01:25 PM

    Before displaying the second screen, you can try using the following statement:

    LEAVE TO LIST-PROCESSING AND RETURN TO SCREEN 0.

    By doing this, the control will go back to your selection screen and the you can call the required screen for ALV.

    So the sequence will be as follows:

    1. Execute the Report

    2. Call the screen or Do the Processing

    3. Before calling the third screen leave back to list processing and return to screen 0.

    4. Call the third screen.

    now you press back button the control goes back into the first screen.

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Dec 01, 2009 at 07:24 AM

    Hi.

    Just use

    when 'BACK'.

    leave to screen 0.

    this will work fine.

    Add a comment
    10|10000 characters needed characters exceeded

    • 1) To return to the selection screen use this:

      LEAVE TO SCREEN 0.

      2) To quit the selection screen via the back button:

      For the selection screen you have a specific event to handle the quiting of your program.

      Use this for exiting the selection screen.

      ----


      AT SELECTION-SCREEN ON EXIT-COMMAND.

      ----


      LEAVE PROGRAM.

      The combination of these two did the trick for me.

      Best regards,

      Tom.

  • author's profile photo Former Member
    Former Member
    Posted on Nov 24, 2009 at 05:39 AM

    Save Our Environment. Save Yourself.

    Hi Kernel,

    Try writing code for BACK also, as calling the first screen directly, as you wrote the code for QSAVE.

    - I'm not an environmentalist. I'm an Earth warrior.

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Nov 24, 2009 at 05:46 AM

    I tried the next:

    SET SCREEN 0.

    LEAVE SCREEN.

    doesn't work 😔

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Nov 24, 2009 at 05:51 AM

    Hi Kernal,

    To go back to the First Screen (Selection Scree) use

    LEAVE TO SCREEN 0. " This makes the Program to go back from where it had started

    or Create a Tcode for your program

    CASE e_ucomm.
    WHEN 'BACK'.
    LEAVE TO TRANSACTION 'YOUR TCODE HERE' . " This will take you back to your Selection Screen
    WHEN 'QSAVE'.
    PERFORM save_data.
    CALL SCREEN 1001.
    WHEN OTHERS.
    ENDCASE.

    Cheerz

    Ram

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Nov 24, 2009 at 05:59 AM

    Hi Kernel,

    try this:

    When 'BACK'.

    CALL SELECTION-SCREEN <dynnr- ur selection-screen number>.

    Regards,

    Swarna Munukoti

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Nov 24, 2009 at 06:23 AM

    Thank you for your answers, but

    LEAVE TO TRANSACTION 'YOUR TCODE HERE' works but selection screen values not retrieved.

    CALL SELECTION-SCREEN 1000. works too, but when I get on the selection screen and press there BACK button it will returned me to the previous screen (1001 in my case)

    There is interesting thing: if I use standart SAVE button in the screen 1001 and If I set SET SCREEN 0. in the 1002 screen initialization the BACK button will return me on the selection screen, Exactly what I wanted. But I use custom save button on the grid I think it rewrites the state or something like and operator SET SCREEN 0.doesn't work in that case.

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member Former Member

      Hi,

      Yes, when you called back button from selection screen, the PAI of thrid screen is getting called. So it is not wokring

      Try this one:

      Declare a flag globally: fg_selscrn.

      Now in third screen PAI:

      when 'BACK'.

      if fg_selscrn is initial.

      fg_selscrn = 'X'.

      CALL SELECTION-SCREEN <dynnr> .

      else.

      clear fg_selscrn.

      LEAVE PROGRAM.

      endif.

      Regards,

      Swarna Munukoti.

  • author's profile photo Former Member
    Former Member
    Posted on Nov 24, 2009 at 06:38 AM

    Tarun, it occurs an error, Must use CALL SELECTION-SCREEN.

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.