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: 

How to insert ALV grid into subscreen of tabstrip?

Former Member
0 Kudos
6,575

How to insert ALV grid into subscreen of tabstrip?

One alv grid need to be displayed on the first tab of a tabstrip, below is code, but when excute, always with error dump screen, please help, thanks.

1 ACCEPTED SOLUTION

Former Member
0 Kudos
663

hi,

check this code.

write this code in the pbo module of the sub screen (which is attached to the tab).

G_CONTAINER is the container name in the sub screen.

IF G_CUSTOM_CONTAINER IS INITIAL.

CREATE OBJECT G_CUSTOM_CONTAINER

EXPORTING CONTAINER_NAME = G_CONTAINER.

CREATE OBJECT GRID1

EXPORTING I_PARENT = G_CUSTOM_CONTAINER.

PERFORM LAYOUT.

PERFORM FIELD_CAT.

PERFORM FILL_DATA.

CALL METHOD GRID1->SET_TABLE_FOR_FIRST_DISPLAY

EXPORTING

IS_LAYOUT = LAYOUT

CHANGING

IT_FIELDCATALOG = FCAT[]

IT_OUTTAB = GT_ZTMW_HEADER_HIS.

ENDIF.

4 REPLIES 4

Former Member
0 Kudos
663

REPORT z1 .

TABLES: spfli.

  • chang to ALV

  • SLECTION-SCREEN BEGIN OF SCREEN 1100 AS SUBSCREEN.

*SELECTION-SCREEN BEGIN OF BLOCK b2.

*PARAMETERS: button1 RADIOBUTTON GROUP a DEFAULT 'X',

  • button2 RADIOBUTTON GROUP a.

*SELECTION-SCREEN END OF BLOCK b2.

*SELECTION-SCREEN END OF SCREEN 1100.

DATA: opcode_get_session_id TYPE x VALUE 68.

DATA: session_id(32) TYPE c.

DATA: id_len TYPE i.

DATA:

save_ok TYPE sy-ucomm.

DATA: ok_code LIKE sy-ucomm,

gt_sflight TYPE TABLE OF sflight,

g_container TYPE scrfname VALUE 'BCALV_GRID_DEMO_0100_CONT1',

grid1 TYPE REF TO cl_gui_alv_grid,

g_custom_container TYPE REF TO cl_gui_custom_container.

*definitions for tabstrip

CONSTANTS: BEGIN OF c_t_tabstrip,

tab1 LIKE sy-ucomm VALUE 'T_TABSTRIP_FC1',

tab2 LIKE sy-ucomm VALUE 'T_TABSTRIP_FC2',

  • TAB3 LIKE SY-UCOMM VALUE 'T_TABSTRIP_FC3',

  • TAB4 LIKE SY-UCOMM VALUE 'T_TABSTRIP_FC4',

  • TAB5 LIKE SY-UCOMM VALUE 'T_TABSTRIP_FC5',

END OF c_t_tabstrip.

*&SPWIZARD: DATA FOR TABSTRIP 'T_TABSTRIP'

CONTROLS: t_tabstrip TYPE TABSTRIP.

DATA: BEGIN OF g_t_tabstrip,

subscreen LIKE sy-dynnr,

prog LIKE sy-repid VALUE 'ZQ8I_TET6',

pressed_tab LIKE sy-ucomm VALUE c_t_tabstrip-tab1,

END OF g_t_tabstrip.

*----


  • START-OF-SELECTION

*----


START-OF-SELECTION.

CALL SCREEN 100.

&----


*& Module STATUS_0100 OUTPUT

&----


  • text

----


MODULE status_0100 OUTPUT.

SET PF-STATUS 'SCREEN_100'.

ENDMODULE. " STATUS_0100 OUTPUT

----


  • MODULE cancel INPUT

----


*

----


MODULE cancel INPUT.

LEAVE PROGRAM.

ENDMODULE. "cancel INPUT

----


  • MODULE user_command_0100 INPUT

----


*

----


MODULE user_command_0100 INPUT.

save_ok = ok_code.

CLEAR ok_code.

CASE save_ok.

WHEN 'tab1'.

  • mytabstrip-activetab = save_ok.

  • number = 1100.

  • WHEN 'BUTTON2'.

  • mytabstrip-activetab = save_ok.

  • number = 1200.

ENDCASE.

ENDMODULE. "user_command_0100 INPUT

----


  • MODULE PBO OUTPUT *

----


MODULE pbo OUTPUT.

  • SET PF-STATUS 'MAIN100'. "can not be set in subscreen

SELECT * FROM sflight INTO TABLE gt_sflight WHERE carrid = 'LH'.

IF g_custom_container IS INITIAL.

CREATE OBJECT g_custom_container

EXPORTING container_name = g_container.

CREATE OBJECT grid1

EXPORTING i_parent = g_custom_container.

CALL METHOD grid1->set_table_for_first_display

EXPORTING

i_structure_name = 'SFLIGHT'

CHANGING

it_outtab = gt_sflight.

ENDIF.

ENDMODULE. "PBO OUTPUT

----


  • MODULE PAI INPUT *

----


MODULE pai INPUT.

  • to react on oi_custom_events:

CALL METHOD cl_gui_cfw=>dispatch.

CASE ok_code.

WHEN 'EXIT'.

PERFORM exit_program.

WHEN OTHERS.

  • do nothing

ENDCASE.

CLEAR ok_code.

ENDMODULE. "PAI INPUT

----


  • FORM EXIT_PROGRAM *

----


FORM exit_program.

  • CALL METHOD G_CUSTOM_CONTAINER->FREE.

  • CALL METHOD CL_GUI_CFW=>FLUSH.

LEAVE PROGRAM.

ENDFORM. "EXIT_PROGRAM

&----


*& Module T_TABSTRIP_ACTIVE_TAB_SET OUTPUT

&----


  • text

----


MODULE t_tabstrip_active_tab_set OUTPUT.

t_tabstrip-activetab = g_t_tabstrip-pressed_tab.

CASE g_t_tabstrip-pressed_tab.

WHEN c_t_tabstrip-tab1.

g_t_tabstrip-subscreen = '1100'.

  • WHEN c_t_tabstrip-tab2.

  • g_t_tabstrip-subscreen = '1100'.

  • WHEN C_T_TABSTRIP-TAB3.

  • G_T_TABSTRIP-SUBSCREEN = '2430'.

  • WHEN C_T_TABSTRIP-TAB4.

  • G_T_TABSTRIP-SUBSCREEN = '2440'.

  • WHEN C_T_TABSTRIP-TAB5.

  • G_T_TABSTRIP-SUBSCREEN = '2450'.

WHEN OTHERS.

*&SPWIZARD: DO NOTHING

ENDCASE.

ENDMODULE. " T_TABSTRIP_ACTIVE_TAB_SET OUTPUT

Former Member
0 Kudos
664

hi,

check this code.

write this code in the pbo module of the sub screen (which is attached to the tab).

G_CONTAINER is the container name in the sub screen.

IF G_CUSTOM_CONTAINER IS INITIAL.

CREATE OBJECT G_CUSTOM_CONTAINER

EXPORTING CONTAINER_NAME = G_CONTAINER.

CREATE OBJECT GRID1

EXPORTING I_PARENT = G_CUSTOM_CONTAINER.

PERFORM LAYOUT.

PERFORM FIELD_CAT.

PERFORM FILL_DATA.

CALL METHOD GRID1->SET_TABLE_FOR_FIRST_DISPLAY

EXPORTING

IS_LAYOUT = LAYOUT

CHANGING

IT_FIELDCATALOG = FCAT[]

IT_OUTTAB = GT_ZTMW_HEADER_HIS.

ENDIF.

0 Kudos
663

thanks BHARAT, but these codes had already exist in my program.

Runtime errors CONTROL_NOT_FOUND

Occurred on 15.03.2007 at 07:03:32

There is no help text for this dump

Either the text was inadvertently deleted or the release of

the kernel differs from that of the database.

Refer to the Note system for further information on this dump.

000270 * Nach DCO

000280 module %_CTL_OUTPUT output.

000290 perform %_CTL_OUTPUT in program SAPMSSYD using SY-REPID if found.

> endmodule.

000310

0 Kudos
663

I found someting useful here.