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

AlV back button

Former Member
0 Likes
385

Hi ,

Iam woking on a ALV report where I have provided check boxes for user to select deslect sales orders .

when user first selects and deselects records and click back button it is coming to the screen with check boxes selected and then to my selection screen.

I tried using leave to screen 1000. but when i click on that back buton its not leaving the program where as going ALV out put.

tried using leave program. But user needs to come to selection screen after clicking back insted os leaving the program.

Very urgent Please help.

3 REPLIES 3
Read only

Former Member
0 Likes
355

try using leave to screen 0.

and submit ABAP_PROGRAM_NAME. it will take user to the selection screen.

hope this will help

Ashwani

Read only

Former Member
0 Likes
355
MODULE user_command_9001 INPUT.
 
  CASE sy-ucomm.
    WHEN 'BACK'.
 SET SCREEN '0'
OR 
LEAVE PROGRAM.
   WHEN 'EXIT' OR  'CANC'.
      PERFORM exit_program.
      LEAVE PROGRAM.
  ENDCASE.
 
ENDMODULE.                 “USER_COMMAND_9000 INPUT

Hope this helps.

Read only

Former Member
0 Likes
355

If the BACK button is in the toolbar of ALV container then proceed as follows

Assume u r code is as below

CLASS c1 DEFINITION.

PUBLIC SECTION.

METHODS:

toolbar FOR EVENT toolbar OF cl_gui_alv_grid IMPORTING e_object

e_interactive,

user_command FOR EVENT user_command OF cl_gui_alv_grid IMPORTING

e_ucomm.

ENDCLASS.

CLASS c1 IMPLEMENTATION.

METHOD toolbar.

DATA: ls_toolbar TYPE stb_button.

CLEAR ls_toolbar.

MOVE 'BACK' TO ls_toolbar-function.

MOVE 'BACK' TO ls_toolbar-text.

MOVE ' ' TO ls_toolbar-disabled.

APPEND ls_toolbar TO e_object->mt_toolbar.

ENDMETHOD.

METHOD user_command.

<b> CASE e_ucomm.

WHEN 'BACK'.

LEAVE PROGRAM.

ENDCASE.

</b> ENDMETHOD.

If the BACK button is outside the container then proceed as follows

<b>MODULE user_command_0100 INPUT.

CASE sy-ucomm.

WHEN 'EXIT'.

LEAVE PROGRAM.

ENDCASE.

ENDMODULE. " USER_COMMAND_0100 INPUT</b>