cancel
Showing results for 
Search instead for 
Did you mean: 

Number of rows in the ALV, Web - dynpro

AntonPierhagen
Active Participant
0 Kudos

Hi all

I have an ALV in my ABAP web-dynpro. For this alv i would like to set the visible rows at the same number as there are rows in the internal table which is the supplier for the ALV.

In the TABLE component of the WEBDYNPRO you have a visible property who is controlling this.

I saw that for the ALV you had the same. Of the class IF_SALV_WD_TABLE_SETTINGS there is a method SET_VISIBLE_ROW_COUNT. So i thought this is the one where i can control it.

So when the table has 10 rows, 10 rows will be displayedon the screen and when the table has 20 rows, 20 rows will be displayed on the screen.

But this is not the case.

Is there something i forget?

Kind regards,

Anton Pierhagen

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi,

Whatever you have mentioned is correct. It should work. Could you post the code you are using to set visible row count?

Best Regads,

Srilatha

AntonPierhagen
Active Participant
0 Kudos

METHOD wddoinit .

DATA: lo_column TYPE REF TO cl_salv_wd_column,

lo_cmp_usage TYPE REF TO if_wd_component_usage,

lo_interfacecontroller TYPE REF TO iwci_salv_wd_table,

lt_functions TYPE salv_wd_t_function_std_ref,

ls_function TYPE salv_wd_s_function_std_ref,

lo_function TYPE REF TO cl_salv_wd_function_std,

lo_data TYPE REF TO if_wd_context_node,

lo_element TYPE REF TO if_wd_context_element,

lv_index TYPE i,

lo_model TYPE REF TO cl_salv_wd_config_table.

  • Retrieve ALV object

lo_cmp_usage = wd_this->wd_cpuse_alv( ).

  • Initial? Create new

IF lo_cmp_usage->has_active_component( ) IS INITIAL.

lo_cmp_usage->create_component( ).

ENDIF.

  • Interfacecontroller

lo_interfacecontroller = wd_this->wd_cpifc_alv( ).

lo_model = lo_interfacecontroller->get_model( ).

  • Get main NODE DATA, this is the node which supplies the ALV

lo_data = wd_context->get_child_node( name = 'DATA' ).

  • How many rows has the table?

lv_index = lo_data->GET_ELEMENT_COUNT( ).

  • Not more then 20 rows on the screen

IF lv_index GT 20.

lv_index = 20.

ENDIF.

  • Put the number of rows in the screen

lo_model->if_salv_wd_table_settings~set_visible_row_count( lv_index ).

  • should the screen set to freeze?

lo_model->if_salv_wd_table_settings~set_fixed_table_layout( abap_true ).

gill367
Active Contributor
0 Kudos

Code is correct

what is the error message you are getting

or what is the out put you are getting..

thanks

AntonPierhagen
Active Participant
0 Kudos

There is unfortunately no error. But the default size of the ALV is 10 and it stays 10.

I put the code in the WDDOINIT method of the view which uses the ALV. It is the correct section i thought?

Former Member
0 Kudos

hi,

Are you sure that no where else this code is used

lo_model->if_salv_wd_table_settings~set_visible_row_count( lv_index ).

Some where you are overwriting to 10.

AntonPierhagen
Active Participant
0 Kudos

Nope. Only at that point

Former Member
0 Kudos

Hi,

can you try to set the visible number of rows in wdDoModifyView and see if it works??

Best Regards,

Srilatha

AntonPierhagen
Active Participant
0 Kudos

Ok ! Thanks i will try that

AntonPierhagen
Active Participant
0 Kudos

Unfortunately. It returns the 20 i set in the WDDOINIT and still it returns to the default 10..

hmm...

Former Member
0 Kudos

Hi,

I didnt get you. Can you please tell whether its working or not??

Best Regards,

Srilatha

AntonPierhagen
Active Participant
0 Kudos

it won;t work.

In WDDOINIT i set the value to 20. In the other method i see the 20 as value. The ALV is filled with 10 the default value. THe one i changed in WDDOINIT. so unfortunately..

Former Member
0 Kudos

i hope the problem is not because of this statement:

  • should the screen set to freeze?

lo_model->if_salv_wd_table_settings~set_fixed_table_layout( abap_true ).

Try to comment this one and see once. Just a trial.

gill367
Active Contributor
0 Kudos

MAKE SURE THAT YOU ARE NOT USING THE SET DATA METHOD

lo_interfacecontroller->set_data( ).

IF YOU USE IT AFTER FIXING THE NUMBER OF ROWS THAT WILL REFRESH THE TABLE SETTINGS.

THANKS

AntonPierhagen
Active Participant
0 Kudos

unfortunately...

AntonPierhagen
Active Participant
0 Kudos

Thanks for the advice, but that one i have not in the code.. hmm strange..

gill367
Active Contributor
0 Kudos

ok do one thing

i guess you are doing some modifications to the alv related with functions in wddoinit.

so do one thing write this setting visible row in the end after all the statements

* Put the number of rows in the screen
lo_model->if_salv_wd_table_settings~set_visible_row_count( lv_index ).

and paste your full code of wddoinit.

and if possible write the code for setting visible row in wddomodifyview method itself

Former Member
0 Kudos

One of the last option i think is that Personalization/Customization

Can you check if there is any personalization for salv_wd_table ,

start this service from SICF transaction

/default_host/sap/bc/webdynpro/sap/wd_analyze_config_user

If there is any entry for this component or your component ,delete the entries. retest the application.

Former Member
0 Kudos

Hi,

The same code works for me even if i put the code in wdDoInit(). Did you check in debug mode if lv_index is having the correct value?

and make sure you are not setting the data again elsewhere.

Best Regards,

srilatha

AntonPierhagen
Active Participant
0 Kudos

Thank you very much! But how does those entries came here? Do you also know that? So that we can avoid such situations in the future.

Also very much thanks for all the others !!

Former Member
0 Kudos

Hi,

I think someone with administrator rights or the user who experienced this problem has done personalization.

Answers (0)