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 Report using OOPS - Back button(F3) flow not correct

former_member205101
Participant
0 Likes
1,992

Hi,

When i try to execute my report (F8) and it goes to output screen perfectly.

Then if i hit back button(F3) it comes to selection screen that's also fine.

after then if i hit back button(F3) then it goes to output screen again.

actually it has to go to the SE38 - program screen

..........

My GUI logic:

&----


*& Include ZSD_GUILOGIC

&----


&----


*& Module init_0100 OUTPUT

&----


  • text

----


MODULE init_0100 OUTPUT.

call method cl_gui_cfw=>dispatch.

  • create the report object

if my_report is initial.

CREATE OBJECT MY_REPORT

EXPORTING

SO_VKORG = so_vkorg[]

SO_VTWEG = so_vtweg[]

SO_DATE = so_date[].

endif.

IF my_CUSTOM_CONTAINER IS INITIAL.

CREATE OBJECT my_CUSTOM_CONTAINER

EXPORTING

CONTAINER_NAME = _CONTAINER.

CREATE OBJECT my_GRID1

EXPORTING

I_PARENT = my_CUSTOM_CONTAINER.

int_tab = my_report->RETURN_RESULT( ).

CALL METHOD my_GRID1->SET_TABLE_FOR_FIRST_DISPLAY

EXPORTING

is_variant = my_layout

i_save = 'A'

i_default = 'X'

I_STRUCTURE_NAME = structure

CHANGING

IT_OUTTAB = int_tab[].

else.

  • container actually exists.

int_tab = my_report->RETURN_RESULT( ).

MY_grid1->refresh_table_display( ).

endif.

ENDMODULE. " init_0100 OUTPUT

&----


*& Module USER_COMMAND_0100 INPUT

&----


  • text

----


MODULE USER_COMMAND_0100 INPUT.

  • to react on oi_custom_events:

CASE OK_CODE.

WHEN 'EXIT'.

PERFORM EXIT_PROGRAM.

when 'BACK'.

clear: my_report, my_CUSTOM_CONTAINER, my_grid1, int_tab.

  • leave

CALL SELECTION-SCREEN 1000.

WHEN 'REFRESH'.

  • int_tab = my_report->RETURN_RESULT( ).

WHEN OTHERS.

  • do nothing

ENDCASE.

CLEAR OK_CODE.

ENDMODULE. " USER_COMMAND_0100 INPUT

&----


*& Form EXIT_PROGRAM

&----


  • text

----


  • --> p1 text

  • <-- p2 text

----


FORM EXIT_PROGRAM .

LEAVE PROGRAM.

ENDFORM. " EXIT_PROGRAM

&----


*& Module STATUS_0100 OUTPUT

&----


  • text

----


MODULE STATUS_0100 OUTPUT.

SET PF-STATUS 'MAIN0100'.

  • SET TITLEBAR 'xxx'.

ENDMODULE. " STATUS_0100 OUTPUT

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,713

Hi,

Use the following:

WHEN 'BACK'.

SET SCREEN 0. LEAVE SCREEN.

Regards,

Deepak.

Hi,

When i try to execute my report (F8) and it goes to output screen perfectly.

Then if i hit back button(F3) it comes to selection screen that's also fine.

after then if i hit back button(F3) then it goes to output screen again.

actually it has to go to the SE38 - program screen

..........

My GUI logic:

&----


*& Include ZSD_GUILOGIC

&----


&----


*& Module init_0100 OUTPUT

&----


  • text

----


MODULE init_0100 OUTPUT.

call method cl_gui_cfw=>dispatch.

  • create the report object

if my_report is initial.

CREATE OBJECT MY_REPORT

EXPORTING

SO_VKORG = so_vkorg[]

SO_VTWEG = so_vtweg[]

SO_DATE = so_date[].

endif.

IF my_CUSTOM_CONTAINER IS INITIAL.

CREATE OBJECT my_CUSTOM_CONTAINER

EXPORTING

CONTAINER_NAME = _CONTAINER.

CREATE OBJECT my_GRID1

EXPORTING

I_PARENT = my_CUSTOM_CONTAINER.

int_tab = my_report->RETURN_RESULT( ).

CALL METHOD my_GRID1->SET_TABLE_FOR_FIRST_DISPLAY

EXPORTING

is_variant = my_layout

i_save = 'A'

i_default = 'X'

I_STRUCTURE_NAME = structure

CHANGING

IT_OUTTAB = int_tab[].

else.

  • container actually exists.

int_tab = my_report->RETURN_RESULT( ).

MY_grid1->refresh_table_display( ).

endif.

ENDMODULE. " init_0100 OUTPUT

&----


*& Module USER_COMMAND_0100 INPUT

&----


  • text

----


MODULE USER_COMMAND_0100 INPUT.

  • to react on oi_custom_events:

CASE OK_CODE.

WHEN 'EXIT'.

PERFORM EXIT_PROGRAM.

when 'BACK'.

clear: my_report, my_CUSTOM_CONTAINER, my_grid1, int_tab.

  • leave

CALL SELECTION-SCREEN 1000.

WHEN 'REFRESH'.

  • int_tab = my_report->RETURN_RESULT( ).

WHEN OTHERS.

  • do nothing

ENDCASE.

CLEAR OK_CODE.

ENDMODULE. " USER_COMMAND_0100 INPUT

&----


*& Form EXIT_PROGRAM

&----


  • text

----


  • --> p1 text

  • <-- p2 text

----


FORM EXIT_PROGRAM .

LEAVE PROGRAM.

ENDFORM. " EXIT_PROGRAM

&----


*& Module STATUS_0100 OUTPUT

&----


  • text

----


MODULE STATUS_0100 OUTPUT.

SET PF-STATUS 'MAIN0100'.

  • SET TITLEBAR 'xxx'.

ENDMODULE. " STATUS_0100 OUTPUT

11 REPLIES 11
Read only

Former Member
0 Likes
1,713

Hi,

Instead of CALL SELECTION-SCREEN 1000.

Use LEAVE TO SCREEN 0.

Thanks

Naren

Read only

0 Likes
1,713

You can also try

> LEAVE TO CURRENT TRANSACTION.

Read only

0 Likes
1,713

Hi Naren,

when i try to do ur way, after the output of report (after double times F8). it directly goes back to SE38 screen.

from the output of the report screen ...actually i want the screen has to go back to user input screen when i press BACK button(F3) one time.

again if i press back button(f3) , then it goes back to SE38 screen.

Thanks

Prabaharan

Edited by: Prabaharan Rangasamy on Apr 14, 2009 5:46 PM

Read only

0 Likes
1,713

Hi,

In the screen attribute make the Next screen as 0 instead of 0100.

(Double click on the screen 100 and in attribute tab Next screen as 0)

and

MODULE USER_COMMAND_0100 INPUT.

  • to react on oi_custom_events:

CASE OK_CODE.

when 'BACK'.

LEAVE TO SCREEN 0.

Read only

Former Member
0 Likes
1,714

Hi,

Use the following:

WHEN 'BACK'.

SET SCREEN 0. LEAVE SCREEN.

Regards,

Deepak.

Read only

Former Member
0 Likes
1,713

Hi,

How are you calling the screen 0100..?

DO this...

START-OF-SELECTION.

CALL SCREEN '0100'.   " This will display the OO ALV.

*In the user command code...make sure you have this..

MODULE USER_COMMAND_0100 INPUT.
* to react on oi_custom_events:
CASE OK_CODE.
  when 'BACK'.
      LEAVE TO SCREEN 0.

Hope this helps.

Thanks

Naren

Read only

0 Likes
1,713

HI,

Thanks for ur replies.

I am calling selection screen 100 like this.

REPORT ZSD_.

INCLUDE ZSD__TOP.

INCLUDE ZSD_LCL000.

INCLUDE ZSD_GUILOGIC.

initialization.

move 'IEQ000' to so_vrsio.

append so_vrsio.

move 'IEQ' to so_date.

so_date-low = sy-datum.

so_date-high = sy-datum.

append so_date.

start-of-selection.

  • set the layout

perform prepare_layout changing my_layout.

Thanks

Praba

  • set the structure

structure = 'ZSD_LEVEL0'.

  • call the processing screen 0100

set screen '0100'.

Read only

0 Likes
1,713

HI Naren,

I have user command code like that.

&----


*& Module USER_COMMAND_0100 INPUT

&----


  • text

----


MODULE USER_COMMAND_0100 INPUT.

  • to react on oi_custom_events:

CASE OK_CODE.

WHEN 'EXIT'.

PERFORM EXIT_PROGRAM.

when 'BACK'.

clear: my_report, my_CUSTOM_CONTAINER, my_grid1, int_tab.

LEAVE TO SCREEN 0.

.

  • CALL SELECTION-SCREEN 1000.

WHEN 'REFRESH'.

  • int_tab = my_report->RETURN_RESULT( ).

WHEN OTHERS.

  • do nothing

ENDCASE.

CLEAR OK_CODE.

ENDMODULE. " USER_COMMAND_0100 INPUT

Thanks

Praba

Edited by: Prabaharan Rangasamy on Apr 14, 2009 5:57 PM

Read only

Former Member
0 Likes
1,713

Hi,

Instead of set screen '0100'...

Give CALL SCREEN '0100'

Thanks

Naren

Read only

0 Likes
1,713

HI Naren,

It works now.

Thanks for ur help.

Regards,

Prabaharan

Read only

former_member205101
Participant
0 Likes
1,713

HI,

Thanks for everyone who helped me.