cancel
Showing results for 
Search instead for 
Did you mean: 

How to set visible row count dynamically ?

former_member190818
Active Contributor
0 Kudos

Hi,

I've a requirement to set visible row count dynamically in FPM. Initially there will be only one visible row in the list. Once Insert Row button is clicked I need to show the visible row as 2. I'm not able to find the place where can I set visible row count. The rows are getting appended but not the row count expanding to 2.

Please help.

Thanks,

JMB

Accepted Solutions (0)

Answers (1)

Answers (1)

mmgc_riel
Participant
0 Kudos

Hi,

i raise an event 'Z_SET_ROW_COUNT' with the config_key and the number as parameter
i've created an app_controller in webdynpro and have this added to the configuration settings.
in the method AFTER_PROCESS_BEFORE_OUTPUT of this app controller

CASE io_event->mv_event_id.

     WHEN Z_SET_ROW_COUNT.

       set_visible_row_count(

                       io_event_data = io_event->mo_event_data

                       it_uibbs      = it_uibbs ).

In this new method

METHOD set_visible_row_count .

*******************************************************

* Method in CiVision ABAP Objects Framework.

* @author     : TSS Maarten van Riel

* @version    : 1.2 april 2013

*******************************************************

   DATA:

     lv_visible_row_count               TYPE int4,

     lv_mo_alv                          TYPE string,

     ls_uibb                            TYPE fpm_s_uibb_component,

     ls_config_key                      TYPE wdy_config_key,

     lo_table_settings                  TYPE REF TO if_salv_wd_table_settings,

     lo_config_table                    TYPE REF TO cl_salv_wd_config_table,

     lo_inf_controller                  TYPE REF TO iwci_if_fpm_ui_building_block. "#EC NEEDED

   FIELD-SYMBOLS:

     <fs_salv_wd_table>                 TYPE REF TO iwci_salv_wd_table.

"get information of congifkey and visible rfow form event data

   io_event_data->get_value(

                    EXPORTING

                      iv_key   = /civbb/cl_aof_fpm=>e_aof_event_par-config_key

                    IMPORTING

                      ev_value = ls_config_key ).

   io_event_data->get_value(

                    EXPORTING

                      iv_key   = /civbb/cl_aof_fpm=>e_aof_event_par-visible_row_count

                    IMPORTING

                      ev_value = lv_visible_row_count ).

   LOOP AT it_uibbs INTO ls_uibb

     WHERE instance_key-config_key = ls_config_key.

     lo_inf_controller = ls_uibb-interface_controller.

     lv_mo_alv = 'LO_INF_CONTROLLER->IF_COMPONENTCONTROLLER~MO_ALV'.

     ASSIGN (lv_mo_alv) TO <fs_salv_wd_table>.

     IF sy-subrc = 0.

       IF <fs_salv_wd_table> IS BOUND.

         lo_config_table = <fs_salv_wd_table>->get_model( ).

         lo_table_settings ?= lo_config_table.

         lo_table_settings->set_visible_row_count( lv_visible_row_count ).

         r_result = abap_true.

       ENDIF.

     ENDIF.

   ENDLOOP.

ENDMETHOD.

it works for me.