cancel
Showing results for 
Search instead for 
Did you mean: 

Multiple views of ALV

ArtiBhat
Associate
Associate
0 Kudos

Hi All,

How to view different columns in ALV at different times depending on the users choice.

Rgds,

Arti.

Accepted Solutions (0)

Answers (3)

Answers (3)

0 Kudos

Hi Arti,

You can hide/unhide specific columns in your ALV data based on the user need, or based on a particular scenario. You can use the following code to achieve hiding/unhiding of columns:

DATA: lo_config_model_value TYPE REF TO cl_salv_wd_config_table. " Configuration Model

DATA: lo_column TYPE REF TO cl_salv_wd_column. "Column

  • Get the configuration model. Call interface method GET_MODEL.

lo_interfacecontroller = wd_this->wd_cpifc_alv( ).

lo_config_model_value = lo_interfacecontroller->get_model( ).

  • Make columns in ALV visible/invisible:

lo_column = lo_config_model_value->if_salv_wd_column_settings~get_column( 'COLUMN_NAME' ). "Column name as in the context attribute associated with a column

lo_column->set_visible( if_wdl_core=>visibility_blank ). "use IF_WDL_CORE=>VISIBILITY_VISIBLE to make a column visible

  • You can also set column positions:

lo_column = lo_config_model_value->if_salv_wd_column_settings~get_column( 'COL_NAME' ).

lo_column->set_position( 0 ).

CLEAR lo_column.

lo_column = lo_config_model_value->if_salv_wd_column_settings~get_column( 'COL2_NAME' ).

lo_column->set_position( 1 ).

Hope this helps.

Best Regards,

Viqar Ali.

ArtiBhat
Associate
Associate
0 Kudos

Hi Viqar,

I want to show different views of ALV, so the user will have the choice to see diferent views depending on his chioice.

rgds,

Arti.

Former Member
0 Kudos

You can specify a new internal data table for the ALV output, you can use the SET_DATA method in the interface controller (IWCI_SALV_WD_TABLE) of the ALV component.

Former Member
0 Kudos

Hi Arti,

If I am not wrong the LAYOUT VARIANTS concept of our ABAP ALV's exist in WDA ALV's too. It's in the form of Views. You will have to enable the Settings button of the ALV Control which will allow you to maintain the Layout Design.

Hope this helps.

Regards

Raja Sekhar

ArtiBhat
Associate
Associate
0 Kudos

Hi Raja,

Could you please tell me how to use these variants.

In my ALV Settings button is already enabled. I want to hard code it. I want to give names to the variants.

Rgds,

Arti.