cancel
Showing results for 
Search instead for 
Did you mean: 

The displayed rows info is not correct in ALV

ArtiBhat
Associate
Associate
0 Kudos

Hi Experts,

The displayed rows info that we get from get_ui_info of component SALV_WD_TABLE is not updated when we reload the ALV.

Could you please provide me with some other option to get the number of displayed rows in ALV.

Best Regards,

Arti.

Accepted Solutions (0)

Answers (6)

Answers (6)

ArtiBhat
Associate
Associate
0 Kudos

Hi Tamil,

get_element_count does not give the correct number when you filter the ALV.

My req is that Table header should display the number of rows that are displayed.

Best Regards,

Arti.

Former Member
0 Kudos

Get the context node which you binded to the alv,use the method 'get_element_count' to get the number of elements,which is nothing but the number of rows in an alv

Regards

Tamil

ArtiBhat
Associate
Associate
0 Kudos

Hi Suman,

Could you please let me know which internal table should be used. From the context you cannot get it as after filtering you still have the same context. It is only by the help of method get_ui_info( ) you get to know about the displayed rows.

which is not working in my case even the context is refreshed on data change and data check.

Best regards,

Arti.

ArtiBhat
Associate
Associate
0 Kudos

Hi Tamil,

Visible row count can give you only the no. of rows that are visible not the avtual count that you can get by scrolling through the ALV.

Best Regards,

Arti.

Former Member
0 Kudos

Actual count of rows you can get by describing the internal table.

data v_lines type i.
describe table itab lines v_lines.

thanks

Suman

Former Member
0 Kudos

try calling the method in wdmodifyview

Former Member
0 Kudos

To get the visible rows in an ALV,Usethe following piece of code

data lo_cmp_usage type ref to if_wd_component_usage.
    data visible_count TYPE i.

  lo_cmp_usage =   wd_this->wd_cpuse_alv( ).
  if lo_cmp_usage->has_active_component( ) is initial.
    lo_cmp_usage->create_component( ).
  endif.

  DATA lo_INTERFACECONTROLLER TYPE REF TO IWCI_SALV_WD_TABLE .
  lo_INTERFACECONTROLLER =   wd_this->wd_cpifc_alv( ).

  DATA lo_value TYPE ref to cl_salv_wd_config_table.
  lo_value = lo_interfacecontroller->get_model(
  ).


VISIBLE_COUNT =  lo_value->IF_SALV_WD_TABLE_SETTINGS~GET_VISIBLE_ROW_COUNT( ).

Regards

Tamil