Skip to Content
0
Former Member
Jul 22, 2009 at 10:01 AM

Output display of two ALV grids one below the other

741 Views

Hi,

Iam using FM REUSE_ALV_GRID_DISPLAY twice to get the output of two ALV grids one below the other like

CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'

EXPORTING

I_CALLBACK_PROGRAM = G_REPID

I_CALLBACK_TOP_OF_PAGE = 'TOP_OF_PAGE'

I_CALLBACK_USER_COMMAND = 'USER_COMM'

IS_LAYOUT = G_LAYOUT

IT_FIELDCAT = T_FIELDCAT[]

I_SAVE = 'X'

TABLES

T_OUTTAB = T_MAIN1.

IF SY-SUBRC <> 0.

ENDIF.

CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'

EXPORTING

I_CALLBACK_PROGRAM = G_REPID

  • I_CALLBACK_TOP_OF_PAGE = 'TOP_OF_PAGE'

I_CALLBACK_USER_COMMAND = 'USER_COMM'

IS_LAYOUT = G_LAYOUT

IT_FIELDCAT = T_FIELDCAT1[]

I_SAVE = 'X'

TABLES

T_OUTTAB = T_POST.

IF SY-SUBRC <> 0.

ENDIF.

When i am using in the above manner ,it's showing the output of T_MAIN1 only. When executing BACK button ,the second table

T_POST is getting displayed.How can i display one below the other. Please help.

I went through SDN forums and copied the code given in them.

  • First Main Container

****CREATE OBJECT main1

  • EXPORTING container_name = 'MAIN_CONTAINER'.

****

  • First Splitter Container

****CREATE OBJECT splitter1

  • EXPORTING parent = main1

  • rows = 2

  • columns = 1.

****

  • Place Container1 in First row First column

****CALL METHOD splitter1->get_container

  • EXPORTING

  • row = 1

  • column = 1

  • RECEIVING

  • container = container1.

****

  • Place Container2 in Second row First column

****CALL METHOD splitter1->get_container

  • EXPORTING

  • row = 2

  • column = 1

  • RECEIVING

  • container = container2.

****

  • Create grids

  • CREATE OBJECT grid1

  • EXPORTING i_parent = container1.

  • ****

    • CREATE OBJECT grid2

    • EXPORTING i_parent = container2.

    ****

    ****CALL METHOD grid1->set_table_for_first_display

    • EXPORTING

    • is_layout = G_LAYOUT

    • CHANGING

    • it_outtab = T_MAIN1

    • it_fieldcatalog = T_FIELDCAT[].

    ****

    • Display itab2 in grid2

  • CALL METHOD grid2->set_table_for_first_display

  • EXPORTING

  • is_layout = G_LAYOUT

  • CHANGING

  • it_outtab = T_POST

  • it_fieldcatalog = T_FIELDCAT1[].

  • In the above case, I am not getting any Output. But in debugging,the data is there in T_MAIN1 and T_POST. Do i need to create any Screen in SE51 with the name 'MAIN_CONTAINER'. Please suggest.

    Thanks

    K Srinivas