cancel
Showing results for 
Search instead for 
Did you mean: 

Selection-Screen + ALV list

Former Member
0 Kudos

hi frnd's,

I had a selection-screen 9000.

When i press execute button in that screen it will display the alv-list.

I had given my own pf-status in the alv list.

when 'back'.

call selection-screen 9000.

I had given for back button.It goes to screen 9000.

but when i click the back in screen 9000 it should leave the program,but it is again back to alvlist.

hlp me pls.

Accepted Solutions (0)

Answers (8)

Answers (8)

Former Member
0 Kudos

Hi,

Why do u want to write different code if your work is getting solved by this??

Anyways,

For going back from ALV, you have written your code in PAI of screen.

For going back from selection-screen, write your code in event

At User-Command.

Again over here, use Leave to screen 0.

Regards,

Tanveer.

If ur satisfied with the answer, please close the thread and please reward points.

Former Member
0 Kudos

hi,

Leave to Screen 0 will do the same job for you.

Declare this in the PAI event of the screen.

Regards,

Tanveer.

Former Member
0 Kudos

Hi Suganya.

In the PAI of the screen,

when 'BACK'.

leave to screen 0.

This has the functionality of going back to the previous screen.

Hope your query is solved.

Regards,

SP.

Former Member
0 Kudos
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
   EXPORTING
    I_CALLBACK_PROGRAM                = W_REPID
    I_CALLBACK_PF_STATUS_SET          = 'PF_STATUS'
 <b>   I_CALLBACK_USER_COMMAND           = 'USER_COMMAND'</b>
    I_GRID_TITLE                      = ' GE-IS LIBRARY'
    IS_LAYOUT                         = WA_LAYOUT
    IT_FIELDCAT                       = IT_FIELDCAT_RAMS_SCREEN
    IT_EVENTS                         = IT_EVENTS
    TABLES
      T_OUTTAB                        =  IT_RAMS_SCR_FLDS
   EXCEPTIONS
     PROGRAM_ERROR                    = 1
     OTHERS                           = 2
            .
  IF SY-SUBRC <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
  ENDIF.

FORM USER_COMMAND USING P_UCOMM TYPE SY-UCOMM
                        P_SELFLD TYPE SLIS_SELFIELD.

  case p_ucomm.
    when 'BACK'.
      leave to screen 0.
  endcase.
ENDFORM.
Former Member
0 Kudos

hi,

Check for the sy-ucomm in PAI event of the screen.

At user-command.

case sy-ucomm.

when 'BACK'.

leave to screen 0.

endcase.

Regards,

Tanveer.

mark helpful answers

Former Member
0 Kudos

Hi suganya ,

case sy-ucomm.

when 'BACK'.

leave to screen 0.

endcase.

Regards,

Tanveer.

Mark helpful answers

Former Member
0 Kudos

Hi Suganya,

In the processing of the back button , you can use the 'leave program' statement. This will do the job.

Regards,

Aniket

Please mark useful answers.

Former Member
0 Kudos

Suganya,

Use LEAVE TO SCREEN 0.

Regards,

Ravi

Former Member
0 Kudos

In Which Event to set the pf-status and check for F3-Back.

No PushButtons are used.

Former Member
0 Kudos

Suganya,

In your PAI you will be handling the funciton codes of the menu right, that is where you need to code this. For the back button, you write the code, whatever function code you have given for BACK button.

Regards,

Ravi

Former Member
0 Kudos

Hi Suganya ,

Set pf-status is always set in the PBO.

After you define pf-status, in the menu painter click on function keys .

There you write BACK against the icon back ( arrow pointing left) . Activate it. Go back to the main program.

When you run,You should get the desired output.

Thanks and Regards,

Kunal.

Message was edited by: Kunal Kumar

Former Member
0 Kudos

The real problem is the selection screen and alv list triggers the same sy-ucomm for back.

i had given in back as

When 'Back'.

Call selection-screen 9000.

so the same back is triggered for both display's.

Former Member
0 Kudos

Hi,

Dont call selection-screen 9000.

That will call selection-screen 9000 from ALV which is already a screen back of ALV.

As a result you will just pile up the screens .

Use Leave to screen 0.

It will take u to previous screen.

That shall solve your problem

Regards,

Tanveer.

Message was edited by: Tanveer Shaikh

Former Member
0 Kudos

When i Use leave to screen 0.

It leaves the program.not to the screen.

Former Member
0 Kudos

Hi Suganya,

You can use 'LEAVE PROGRAM' if you want to leave the program.

Regards,

SP.

Former Member
0 Kudos

Well thats what you wanted.

A back on ALV will take you to slection screen.

A back on selection screen will take you out of program.

Regards,

Tanveer

Former Member
0 Kudos

I dont want to leave the program.i want to leave to selection-screen 9000 when back from alv and then i want to leave the progam.

Former Member
0 Kudos

Hi Tanveer,

U r right,but How to give the separate Ucomm for screen and alv.

I had given separately but only one event is triggered for both.

Former Member
0 Kudos

Hi suganya,

1. do not use the okcode 'BACK'.

2. where u have define your own pf status,

use some other code

eg. BACK1

MYBACK

etc.

3. other wise, standard functionality of BACK

will happen.

4. In case of ALV, we have to specially take care of

this confusion and peculiar behaviour.

regards,

amit m.

Former Member
0 Kudos

Hi,

change the command: 'call screen..' to 'Leave to screen..'.

Regards,

Alexandre

Former Member
0 Kudos

tr ythis

when 'BACK'.

Leave to screen 0.