cancel
Showing results for 
Search instead for 
Did you mean: 

Web Dynpro ALV Grid - Dynamic no of row

Former Member
0 Kudos

Dear expert,

I have a question on how to make a ALV grid having more row based on some triggering.

For example, I have a tray on the upper side of the page, another tray on the lower part of the page containing the SALV Grid.

I have bounded the properties "expanded" to a context attribute.

Where should i put the code that when i click the "Minimize" button on the tray to trigger the code for the following?

DATA:

l_salv_wd_table TYPE REF TO iwci_salv_wd_table,

lo_config_table TYPE REF TO cl_salv_wd_config_table,

lo_interfacecontroller TYPE REF TO iwci_salv_wd_table.

   l_salv_wd_table = wd_this->WD_CPIFC_ALV_PAGE( ).

   lo_interfacecontroller =   wd_this->WD_CPIFC_ALV_PAGE( ).

   lo_config_table = lo_interfacecontroller->get_model).

if lv_tray_info_expanded = abap_false.

lo_config_table->if_salv_wd_table_settings~set_visible_row_count( '30' ).

else.

   lo_config_table->if_salv_wd_table_settings~set_visible_row_count( '15' ).

endif.

Accepted Solutions (1)

Accepted Solutions (1)

ramakrishnappa
Active Contributor
0 Kudos

Hi Christopher,

You can achieve your requirement as below

  • Go to the ui element TRAY and create an action TRAY_TOGGLE for onToggle event as below

    

Write your code in event handler method as below


method ONACTIONTRAY_TOGGLE .

  DATA:
lv_tray_info_expanded TYPE wdy_boolean,
l_salv_wd_table TYPE REF TO iwci_salv_wd_table,

lo_config_table TYPE REF TO cl_salv_wd_config_table,

lo_interfacecontroller TYPE REF TO iwci_salv_wd_table.


"get expanded
  wdevent->get_data(
    EXPORTING name = 'EXPANDED'
    IMPORTING VALUE = lv_tray_info_expanded ).

   l_salv_wd_table = wd_this->WD_CPIFC_ALV_PAGE( ).

   lo_interfacecontroller =   wd_this->WD_CPIFC_ALV_PAGE( ).

   lo_config_table = lo_interfacecontroller->get_model(  ).

if lv_tray_info_expanded = abap_false.

lo_config_table->if_salv_wd_table_settings~set_visible_row_count(
'30' ).

else.

   lo_config_table->if_salv_wd_table_settings~set_visible_row_count(
'15' ).

endif.


endmethod.

Hope this resolves your issue.

Regards,

Rama

Answers (0)