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: 

ALV BACK OR EXIT

Former Member
0 Kudos

Hi,

i do this alv and i wont when i push back that i go to screen before( to selection screen) ,

and when i do exit or cancel go to the code

i try like below but what happen is the same for exit back and cancel

what i miss(all the button bring me to the selection screen)?

Regards

MODULE pai INPUT.

CALL METHOD cl_gui_cfw=>dispatch.
  CASE ok_code.
    WHEN  'BACK'.
*      LEAVE TO SCREEN 0. "FOR LEAVE THE SCREEN TO THE SCREEN BEFORE
      LEAVE PROGRAM.
   WHEN 'EXIT' OR 'CANCEL'.
      IF NOT g_custom_container IS INITIAL.
        CALL METHOD g_custom_container->free.
        CLEAR: g_custom_container.
        FREE : g_custom_container.
        LEAVE TO SCREEN 0.
      ENDIF.
      WHEN OTHERS.
  ENDCASE.
  CLEAR ok_code.

1 ACCEPTED SOLUTION

ferry_lianto
Active Contributor
0 Kudos

Hi,

Please try this.


...

CASE OK_CODE.
  WHEN  'BACK'.
    LEAVE TO SCREEN 0. 

  WHEN 'EXIT' OR 'CANCEL'.
    IF NOT g_custom_container IS INITIAL.
      CALL METHOD g_custom_container->free.
    ENDIF.
     
    CALL METHOD cl_gui_cfw=>flush.
    LEAVE PROGRAM.
 
  WHEN OTHERS.

ENDCASE.

CLEAR OK_CODE.
...

Regards,

Ferry Lianto

4 REPLIES 4

Former Member
0 Kudos

Hi

I can't understand where u need to go after pressing BACK or EXIT push button

Max

0 Kudos

Hi ,

if i pudh:

back -> selection screen.

cancel or exit -> code.

Regards

ferry_lianto
Active Contributor
0 Kudos

Hi,

Please try this.


...

CASE OK_CODE.
  WHEN  'BACK'.
    LEAVE TO SCREEN 0. 

  WHEN 'EXIT' OR 'CANCEL'.
    IF NOT g_custom_container IS INITIAL.
      CALL METHOD g_custom_container->free.
    ENDIF.
     
    CALL METHOD cl_gui_cfw=>flush.
    LEAVE PROGRAM.
 
  WHEN OTHERS.

ENDCASE.

CLEAR OK_CODE.
...

Regards,

Ferry Lianto

0 Kudos

Hi Ferry,

its the same when i push back exit or cancel i go to the code

and not like i wont what i miss?

i do this code in pai module.

Regards