cancel
Showing results for 
Search instead for 
Did you mean: 

How to configure alv grid via application/component configuration

Former Member
0 Kudos

Hello.

Maybe somebody can help me.

I need to configure alv grid in web dynpro.

I need to set columns visiblity, columns order, grouping and etc.

The context is assigned to alv dinamicaly.

How can I do this via application/component configuration?

Thank you very much in advance for your help.

Accepted Solutions (0)

Answers (1)

Answers (1)

Yashpal
Active Contributor
0 Kudos

Hi ,

u can set the properties of alv using this way....

  • create an instance of ALV component

DATA:

lr_salv_wd_table_usage TYPE REF TO if_wd_component_usage.

lr_salv_wd_table_usage = wd_this->wd_cpuse_alv( ).

IF lr_salv_wd_table_usage->has_active_component( ) IS INITIAL.

lr_salv_wd_table_usage->create_component( ).

ENDIF.

  • get ALV component

DATA:

lr_salv_wd_table TYPE REF TO iwci_salv_wd_table.

lr_salv_wd_table = wd_this->wd_cpifc_alv( ).

wd_this->alv_config_table = lr_salv_wd_table->get_model( ).

  • set visible row count

DATA:

lr_table_settings TYPE REF TO if_salv_wd_table_settings.

lr_table_settings ?= wd_this->alv_config_table.

lr_table_settings->set_visible_row_count( '3' ).

  • hide column CURR_ISO

DATA:

lr_column_settings TYPE REF TO if_salv_wd_column_settings,

lr_column TYPE REF TO cl_salv_wd_column.

lr_column_settings ?= wd_this->alv_config_table.

lr_column = lr_column_settings->get_column( 'CURR_ISO' ).

lr_column->set_visible( if_wdl_core=>visibility_none ).

u can see the example WDT_ALV ...

Regards

Yash

Former Member
0 Kudos

Hell Yashpal Gupta.

Thank you for answer.

I know how to do this dynamically.

But i need to do this via application/component configuration