cancel
Showing results for 
Search instead for 
Did you mean: 

WD ALV View change

0 Kudos

Is it possible to change the ALV displayed view on some user action.

E.g.      Initially V1 is displayed and on click of button I want to display V2 view of ALV .

Accepted Solutions (1)

Accepted Solutions (1)

former_member211591
Contributor
0 Kudos

Hi Santosh,

lets change between V1 and V2 by clicking buttons "Load V1" or "Load V2" as given in your picture.

Put following code into the ONACTION*-methods of the buttons (E.G. to load V1):

  

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


   data lr_api type REF TO IF_WD_CONTROLLER.
   lr_api = lo_interfacecontroller->wd_get_api( ).

  data lr_pers_manager type ref to if_wd_personalization.
   lr_pers_manager = lr_api->GET_PERSONALIZATION_MANAGER( ).

  data lt_vars type WDR_PERS_VARIANTS.
   data ls_var type WDR_PERS_VARIANT.
   lt_vars = lr_pers_manager->get_variants( ).

   READ TABLE lt_vars with key description = 'V1' into ls_var.

   data lr_alv_cfg_data_in type IF_SALV_WD_TABLE=>S_TYPE_PARAM_CONFIG_IN.
   data lr_alv_cfg_data type IF_SALV_WD_TABLE=>S_TYPE_PARAM_CONFIG_OUT.

   lr_alv_cfg_data_in-action = '07'.    " This is Action 'LOAD' = 07
   lr_alv_cfg_data_in-view = ls_var.   " This is the view you want to load.

   lr_alv_cfg_data = lo_interfacecontroller->GET_CONFIG_data( lr_alv_cfg_data_in ).
       .

Regards,

ismail

former_member211591
Contributor
0 Kudos

Surprisingly you can load with method "GET_CONFIG_DATA".

The name of the method is a little bit confusing.


0 Kudos

Awsome! Thats what I need.  Thanks a lot.

Answers (1)

Answers (1)

Former Member
0 Kudos

yes you can change by using layout dynammically at run time

0 Kudos

Some idea how? I have predefined global views V1 and V2 , how do I display it. I don't want to build the layout completely by removing or adding fields through program..

0 Kudos

Experts, any input how to do it ?

Former Member
0 Kudos

If you set V1 as entry variant so it is displayed as default and then the user can select V2 from layout dropdownbox, what is your need to put this standard function on a user button?

0 Kudos

In my view I display ALV with some data and I have few buttons on the view. And on click of the button there is logic written to read the ALV table and process the data and display reformatted data again . My requirement is when button is pressed I need to display the data with V2 layout.

Former Member
0 Kudos

If Views V1 and V2 are embedded in the same window, you can just navigate from V1 to V2.

Both V1 and V2 can have ALVs.