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

Dynamic ALV Display

Former Member
0 Likes
372

Hi all,

I have a program where i need to display split screen ALV.

One ALV table on the left and one the right.

In the left ALV i display 10 table names..

If i click on the table name then the table should be displayed in the right side ALV.

This i can successfully doit but if i click on the another table after displaying the one table the new table will not be displayed where as still the first displayed tabled is shown..

Below is my coding please have a look and let me know the error..

TO DISPLAY THE LEFT SIDE ALV..

IF gr_custom_container_02 IS INITIAL.

CREATE OBJECT gr_custom_container_02

EXPORTING

container_name = 'CUSTOM'.

  • Split the Container---------------------------------------------------*

CREATE OBJECT splitter

EXPORTING

parent = gr_custom_container_02

rows = 1

columns = 2.

CALL METHOD splitter->get_container

EXPORTING

row = 1

column = 1

RECEIVING

container = container_1.

  • create the ALV Table-------------------------------------------------*

CREATE OBJECT gr_alv_grid_02

EXPORTING

i_parent = container_1.

  • create Fieldcatalog--------------------------------------------------*

PERFORM prepare_fieldcat_02 CHANGING g_t_fieldcat_02.

  • To Customize the layout

PERFORM prepare_layout_02 CHANGING g_s_layout_02.

  • Show ALV-------------------------------------------------------------*

CALL METHOD gr_alv_grid_02->set_table_for_first_display

EXPORTING

is_layout = g_s_layout_02

CHANGING

it_fieldcatalog = g_t_fieldcat_02

it_outtab = g_t_queuename.

SET HANDLER event_receiver->handle_hotspot_click FOR gr_alv_grid_02.

ELSE.

  • To refresh the table for displaying.

CALL METHOD cl_gui_cfw=>flush.

CALL METHOD gr_alv_grid_02->refresh_table_display

EXCEPTIONS

finished = 1

OTHERS = 2.

ENDIF.

TO DISPLAY THE RIGHT HAND ALV:

CALL METHOD splitter->get_container

EXPORTING

row = 1

column = 2

RECEIVING

container = container_2.

  • create the ALV Table-------------------------------------------------*

CREATE OBJECT gr_alv_grid_03

EXPORTING

i_parent = container_2.

  • create Fieldcatalog--------------------------------------------------*

PERFORM prepare_fieldcat_03 CHANGING g_t_fieldcat_03.

  • Show ALV-------------------------------------------------------------*

CALL METHOD gr_alv_grid_03->set_table_for_first_display

EXPORTING

  • is_layout = g_s_layout_03

i_buffer_active = space

i_bypassing_buffer = 'X'

i_save = 'A'

CHANGING

it_fieldcatalog = g_t_fieldcat_03

it_outtab = <select_queue_table>.

Regards,

Chaithanya.

Hi all,

I have a program where i need to display split screen ALV.

One ALV table on the left and one the right.

In the left ALV i display 10 table names..

If i click on the table name then the table should be displayed in the right side ALV.

This i can successfully doit but if i click on the another table after displaying the one table the new table will not be displayed where as still the first displayed tabled is shown..

Below is my coding please have a look and let me know the error..

TO DISPLAY THE LEFT SIDE ALV..

IF gr_custom_container_02 IS INITIAL.

CREATE OBJECT gr_custom_container_02

EXPORTING

container_name = 'CUSTOM'.

  • Split the Container---------------------------------------------------*

CREATE OBJECT splitter

EXPORTING

parent = gr_custom_container_02

rows = 1

columns = 2.

CALL METHOD splitter->get_container

EXPORTING

row = 1

column = 1

RECEIVING

container = container_1.

  • create the ALV Table-------------------------------------------------*

CREATE OBJECT gr_alv_grid_02

EXPORTING

i_parent = container_1.

  • create Fieldcatalog--------------------------------------------------*

PERFORM prepare_fieldcat_02 CHANGING g_t_fieldcat_02.

  • To Customize the layout

PERFORM prepare_layout_02 CHANGING g_s_layout_02.

  • Show ALV-------------------------------------------------------------*

CALL METHOD gr_alv_grid_02->set_table_for_first_display

EXPORTING

is_layout = g_s_layout_02

CHANGING

it_fieldcatalog = g_t_fieldcat_02

it_outtab = g_t_queuename.

SET HANDLER event_receiver->handle_hotspot_click FOR gr_alv_grid_02.

ELSE.

  • To refresh the table for displaying.

CALL METHOD cl_gui_cfw=>flush.

CALL METHOD gr_alv_grid_02->refresh_table_display

EXCEPTIONS

finished = 1

OTHERS = 2.

ENDIF.

TO DISPLAY THE RIGHT HAND ALV:

CALL METHOD splitter->get_container

EXPORTING

row = 1

column = 2

RECEIVING

container = container_2.

  • create the ALV Table-------------------------------------------------*

CREATE OBJECT gr_alv_grid_03

EXPORTING

i_parent = container_2.

  • create Fieldcatalog--------------------------------------------------*

PERFORM prepare_fieldcat_03 CHANGING g_t_fieldcat_03.

  • Show ALV-------------------------------------------------------------*

CALL METHOD gr_alv_grid_03->set_table_for_first_display

EXPORTING

  • is_layout = g_s_layout_03

i_buffer_active = space

i_bypassing_buffer = 'X'

i_save = 'A'

CHANGING

it_fieldcatalog = g_t_fieldcat_03

it_outtab = <select_queue_table>.

Regards,

Chaithanya.

1 REPLY 1
Read only

Former Member
0 Likes
330

Hi,

You should develop an event handler method where you will catch the click on the left container. There you should evaluate the the data and you should free the ALV grid from the right container and then you should call the method set_table_for_first_display with the data that you want. At the end you should call the static method CL_GUI_CFW=>FLUSH to synchronize the ALV framework.

With Regards

George