Application Development and Automation 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: 
Read only

Selection screen navigation error in OOPS ALV

Former Member
0 Likes
6,800

Hi ,

In my ALV report I have one selection screen and two normal screen.

                                                                  double click

In this report run like : selection screen---> Screen (1000) ---> screen (2000).

                              screen (1000)again  <,-- Back             <---    Back

From screen 1000 to selection screen it giving dump ( from custome controller object ) if I press Back button.

In debug mode I checked, if I click Back button it again come from PAI(1000) to PBO(1000) again.

In PAI module of 1000 I wrote :

                                            LEAVE TO SCREEN 0.

I also try with : set sclection screen and call transaction ,but giving same dump from selection screen.

Please help.

Thanks,

SK

22 REPLIES 22
Read only

Former Member
0 Likes
6,367

try

Leave to transaction.

leave to screen 0 should work.  The issue might be with the selection screen components also.

Does this happen every time you click the back button from screen 1000?

Read only

0 Likes
6,367

yes..

Read only

0 Likes
6,367

Did you try changing the screen numbers to 100 and 200 as suggested by Eitan? That is a very probable reason.

Read only

0 Likes
6,367

I have change the screen name like :

                                                                  double click

In this report run like : selection screen---> Screen (0100) ---> screen (0200).

                              screen (1000)again  <,-- Back             <---    Back

But still not working

Read only

rosenberg_eitan
Active Contributor
0 Likes
6,367


Hi,

As far as I know screen 1000 is generated from the selection parameters .

So I believe that you need to leave screen 1000 alone .

Create screens 100 and 200 Using the screen painter .

In this example I was doing drill down from screen 100 to screen 200 .

So at some point in screen 100 (Hot spot event on cl_gui_alv_gri) I execute "LEAVE TO SCREEN 200 ."

"MODULE pai_exit AT EXIT-COMMAND" is triger when you set a function as exit.

Some Code :

START-OF-SELECTION .
  PERFORM at_start_of_selection .
 
 
*----------------------------------------------------------------------*
*----------------------------------------------------------------------*
FORM at_start_of_selection .

  CALL SCREEN 100 .

ENDFORM .                    "at_start_of_selection
*----------------------------------------------------------------------*
*----------------------------------------------------------------------*

* Screen 100 and 200 logic:
PROCESS BEFORE OUTPUT.
  MODULE at_pbo .
*
PROCESS AFTER INPUT.
  MODULE at_pai_exit AT EXIT-COMMAND.
  MODULE at_pai_process .
 
*----------------------------------------------------------------------*
*----------------------------------------------------------------------*
* Modules 
MODULE at_pai_exit INPUT.
  PERFORM at_pai_exit .
ENDMODULE .                    "at_pai_exit INPUT
*----------------------------------------------------------------------*
MODULE at_pai_process INPUT .
  PERFORM at_pai_process .
ENDMODULE .                    "at_pai_process INPUT
*----------------------------------------------------------------------*
MODULE pai_exit INPUT.

  ok_save = ok_code .

  CASE ok_save .
    WHEN 'EXIT' .
      LEAVE PROGRAM .
    WHEN 'BACK' OR 'CANCEL' .
      CASE syst-dynnr .
        WHEN 0100 .
          LEAVE TO SCREEN 0 .
        WHEN 0200 .
          LEAVE TO SCREEN 0100 .
      ENDCASE .
  ENDCASE .

ENDMODULE.                    "pai_exit INPUT
*----------------------------------------------------------------------*
MODULE pai_process INPUT.

  ok_save = ok_code.

  CASE syst-dynnr .
    WHEN 0100 .
  ENDCASE .

ENDMODULE.                    "pai_process INPUT

*----------------------------------------------------------------------*
FORM at_pai_process .

  CASE syst-dynnr .
    WHEN 0100 .
      PERFORM at_pai_process_100 .
  ENDCASE .

ENDFORM .                    "at_pai_process
*----------------------------------------------------------------------*
FORM at_pai_process_100 .

  ok_save = ok_code .

ENDFORM .                    "at_pai_process_100
*----------------------------------------------------------------------*

Regards.

Eitan.

Read only

hiriyappa_myageri
Participant
0 Likes
6,367

Hi SK ,

Do not  use Leave to screen 0.

U can use leave to screen 1000.or call screen 1000.

Thanks & Regard's,

Hiriz..

Read only

Former Member
0 Likes
6,367

Hi,

Screen 1000 is for standard selection screen. May be there occur a clash between the screen numbers because of this. Try giving other numbers for two normal screen. Custom screen numbers starting from 9000.

selection screen - 1000 (default one when you design).

first screen - 9001.

second screen - 9002.

PAI of screen 9001.

check the user command. when user command triggered is 'BACK', LEAVE TO SCREEN 0. This directs you to the selection screen.

PAI of screen 9002.

check the user command. when user command triggered is 'BACK', LEAVE TO SCREEN 0. This directs you to the screen 9001.

Regards,

Shahanaz.

Read only

0 Likes
6,367

Hi,

Don't create Normal screen with screen no 1000 as it is default screen no for selection screen.

Create other than 1000 and use LEAVE TO SCREEN 0 in BACK Button.

Assume 1st screen is selection screen(1000) -> 2nd screen screen no (2000)

if you want to come back to screen 1000 from screen 2000 in PF status of screen 2000 in BACK button write LEAVE TO SCREEN 0.

Points appreciated!!

Thanks & Regards,

Lokesh R

Read only

0 Likes
6,367

Hi lokesh ,

I have changed my screen sequence as below :

                                                                  double click

selection screen---> Screen (0100) ---> screen (0200).

                        <,-- Back             <---    Back

But still now it is not working

Read only

0 Likes
6,367

Hi,

Have you set PF status for your screen?

Read only

0 Likes
6,367

Hi ,

Can you post your code that deal with the screen flow ?

- Screen flow logic .

- Module code .

- Forms (if used)

Regards.

Eitan.

Read only

0 Likes
6,367

Selection Screen

----------------------------------

start-of-selection

call screen 01000.

Screen 0100

---------------

PBO.

Module alv_display. " alv display , double click

PAI

-------

CASE SY-UCOMM.

WHEN 'BACK'

LEAVE TO SCREEN 0.

WHEN 'EXIT'

LEAVR PROGRAM.

WHEN 'CANCEL'

LEAVE PROGRAM

SCREEN 0200.

-------------------------

PBO.

Module alv_display1 .  " New alv

PAI.

WHEN 'BACK'

CALL SCREEN 0200.

WHEN 'EXIT'

LEAVR PROGRAM.

WHEN 'CANCEL'

LEAVE PROGRAM

Read only

0 Likes
6,366

Hi ,

I do like to help but it is better to be able to look at actual code .

But things that did caught my eyes:

Regards.

Eitan.

Read only

0 Likes
6,366

Hi Eitan,

Sorry it's my typeing mistake :

Selection Screen

----------------------------------

start-of-selection

call screen 0100.

Screen 0100

---------------

PBO.

Module alv_display. " alv display , double click

PAI

-------

CASE SY-UCOMM.

WHEN 'BACK'

LEAVE TO SCREEN 0.

WHEN 'EXIT'

LEAVR PROGRAM.

WHEN 'CANCEL'

LEAVE PROGRAM

SCREEN 0200.

-------------------------

PBO.

Module alv_display1 .  " New alv

PAI.

WHEN 'BACK'

CALL SCREEN 0100.

WHEN 'EXIT'

LEAVR PROGRAM.

WHEN 'CANCEL'

LEAVE PROGRAM

Read only

0 Likes
6,366

Is the exit and cancel button working?'

PAI.

WHEN 'BACK'

CALL SCREEN 0100.

Here dont call screen 100.

Instead use either of the following statements

LEAVE TO SCREEN 100.

or

LEAVE TO SCREEN 0.

Read only

0 Likes
6,365

Hi ,

Things to check:

Are you using:

MODULE at_pai_exit AT EXIT-COMMAND like I do ?


Regards.

Eitan.

Read only

0 Likes
6,365

Hi,

I miss this one thanks ....

Read only

0 Likes
6,365

Hi ,

Do not be ashamed to copy the code that I posted there is no copyright here.....

Read only

0 Likes
6,365

Hi  Eitan,

At first thaks for ur time and post.

Second thing  Your solution is not working for my case .

This problem is now solve .

Thanks you again.

Read only

0 Likes
6,365

Hi ,

Can you share your solution for the benefit of the common knowledge base ?

Regards.
Eitan.

Read only

Former Member
0 Likes
6,365

Hi,

Could you please share the dump screenshot.

Best Regards,

Abirami

Read only

Former Member
0 Likes
6,365

hi,

in all screens the event starts with pbo where u see what should be displayed on the screen and after that it goes to the pai when an enter key pressed or a button is pressed to process the output. Once the pai is over again it goes to the pbo and dispay the final result.

If you are using subscreens then the event goes like this. pbo of activated screen , pai of activated screen, pbo of main screen,pai of main screen pbo of activated screen.

if you want to go the screen from which you navigated then give leave to screen 0.