on 01-09-2014 9:59 AM
Hi Tashi,
Please refer the below link
Selection Variables in ALV view variants
Hope this helps you.
Regards,
Rama
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
i found out my self, Please see a sample code below:
data lo_pers_manager type ref to if_wd_personalization.
data lcl_variants TYPE WDR_PERS_VARIANTS.
data lcl_config_key TYPE WDY_CONFIG_KEY.
DATA lo_INTERFACECONTROLLER TYPE REF TO IWCI_SALV_WD_TABLE .
FIELD-SYMBOLs: <fs_variant> TYPE WDR_PERS_VARIANT.
*Get alv API
lo_api_controller = lo_INTERFACECONTROLLER->wd_get_api( ).
* get personalization manager
lo_pers_manager = lo_api_controller->get_personalization_manager( ).
CALL METHOD lo_pers_manager->GET_VARIANTS
RECEIVING
VARIANTS = lcl_variants
.
READ TABLE lcl_variants ASSIGNING <fs_variant> INDEX 3.
lcl_config_key-config_id = <fs_variant>-config_id.
lcl_config_key-config_type = <fs_variant>-config_type.
lcl_config_key-config_var = <fs_variant>-config_var.
CALL METHOD lo_pers_manager->SET_DEFAULT_VARIANT
EXPORTING
CONFIG_KEY = lcl_config_key
scope = 4.
it worked fine
Hi Tashi,
I have created two Variants for a View in my ALV. I have created them in Customizing-Mode (&sap-config-mode=x) in my Floor Plan Manager (FPM). I have used your previous code to select a variant and all works without any error or syntax mistake. If I try to use that it doesn´t work correctly. The point is that when I am in Customizing-Mode in my FPM it works correctly. The code is the same fot both cases but in a mode it works and in the other it doesn´t work.
When it doesn´t work, it always set the [Standardview] by default, sometimes with the fields of the correct variant and sometimes with all fiels of the structure that I have used in this ALV.
[StandarView] ***********THIS IS MY CURRENT RESULT***************
Col1|Col2|Col3|Col4|Col5|Col6
The result must be a View Variant with some fields that I have customized previously in Customizing-Mode and that I have transported with the correct Customization transport-task.
MyViewVariant ***********ONLY WORKS IN CUSTOMIZING-MODE***************
Col1 |Col4|Col6
How could I solve that to get always the correct view-variant?
Regards,
Sergio.
Hi Sergio,
i am not sure what is the issue, but you can just check if you have set any other view as "initial view" ..The view selected in the code will be displayed only when you dont have any "initial view" selected from the UI.
The code which i have pasted above is for stand alone webdynpro application and it worked fine for me.
Thanks & Regards,
Tashi
User | Count |
---|---|
83 | |
10 | |
10 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.