on 05-10-2011 10:05 AM
Hi,
I have defined an ALV dynamicly. When I add a new column to the ALV it is not displayed. Doing right click and going to 'user settings' I see that the column is added to 'Hide column'. Changing this manually shows that the new column is presented in the ALV.
This only happend if I had once clicked the user settings and did some things and SAVED. So somewhere my user settings are stored.
My question:
- How can I reset my ALV user settings in webdynpro in a way that new defined columns are directly presented ?
- Where are these ALV user settings stored ?
Hope you can help.
Cheers, John
Hi John,
when you initialize your ALV, you can probably make each column visible explicitly. The code for doing that would be:
data: lt_col type salv_wd_t_column_ref,
ls_col type salv_wd_s_column_ref.
lt_col = l_alv_model->if_salv_wd_column_settings~get_columns( ).
loop at lt_col into ls_col.
ls_col-r_column->set_visible( abap_true ).
endloop.
Cheers,
Kris.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
GET_PERSONALIZATION_MANAGER returns IF_WD_PERSONALIZATION object. Can you please check methods in that like GET_VARIANTS method. get the variants info and delete them. Loop through this table and delete them.
lo_cmp_usage = wd_this->wd_cpuse_alv_materials( ).
IF lo_cmp_usage->has_active_component( ) IS INITIAL.
lo_cmp_usage->create_component( ).
ENDIF.
* Get the interface controller of the component usage
lo_interfacecontroller = wd_this->wd_cpifc_alv_materials( ).
* Get the model object of ALV
IF lo_interfacecontroller IS NOT INITIAL.
lv_value = lo_interfacecontroller->get_model(
).
* Get the API reference
lo_api_interfacecontroller = lo_interfacecontroller->wd_get_api( ).
ENDIF.
* Get personalization obect
IF lo_api_interfacecontroller IS NOT INITIAL.
CALL METHOD lo_api_interfacecontroller->get_personalization_manager
RECEIVING
pers_manager = lo_pers.
ENDIF.
* Get variants
IF lo_pers IS NOT INITIAL.
CALL METHOD lo_pers->get_variants
RECEIVING
* there is one more flag related parameter in this, please test that also.
variants = lt_var.
ENDIF.
Hi John,
Try to call this method in WDDOINIT with value
IF_SALV_WD_C_TABLE_SETTINGS=>REFRESH_AND_APPLY_SERVICES.
L_REF_INTERFACECONTROLLER = WD_THIS->WD_CPIFC_ALV( ).
L_REF_INTERFACECONTROLLER->SET_DATA( LO_ND_SYSTEMS ).
L_VALUE = L_REF_INTERFACECONTROLLER->GET_MODEL( ).
L_VALUE->IF_SALV_WD_TABLE_SETTINGS~SET_DISPLAY_TYPE(
IF_SALV_WD_C_TABLE_SETTINGS=>DISPLAY_TYPE_TABLE ).
Cheers,
Kris.
Edited by: kissnas on May 10, 2011 11:48 AM
This is complete code.
L_REF_INTERFACECONTROLLER = WD_THIS->WD_CPIFC_ALV( ).
L_REF_INTERFACECONTROLLER->SET_DATA( LO_ND_SYSTEMS ).
L_VALUE = L_REF_INTERFACECONTROLLER->GET_MODEL( ).
L_VALUE->IF_SALV_WD_TABLE_SETTINGS~SET_DISPLAY_TYPE(
IF_SALV_WD_C_TABLE_SETTINGS=>DISPLAY_TYPE_TABLE ). // Try using different methods in this i am not sure.
cheers,
Kris.
HI John,
As sarbjeeth suggested, get the variant(personalisation info) details from the WD application wd_analyze_config_user.
Run this application and search for the variants of the component SALV_WD_TABLE(ALv component), identify your variant and note the details like config name,config variant, config type etc.
Then in the WDDOINIT , you can try deleting like this.
DATA lo_api_controller TYPE REF TO if_wd_controller.
DATA lo_pers_manager TYPE REF TO if_wd_personalization.
data lv_variants type WDR_PERS_VARIANTS.
data lv_config_key type WDY_CONFIG_KEY.
data lv_bool type wdy_boolean.
* get personalization manager
lo_api_controller = wd_this->wd_get_api( ).
lo_pers_manager = lo_api_controller->get_personalization_manager( ).
lv_config_key-CONFIG_ID = '29A71D1A8C9565ED7315B87A8CC21C94'. "These details are got from the wd_analyze_config_user application
lv_config_key-CONFIG_TYPE = 07.
lv_config_key-CONFIG_VAR = 'ENX0N9'.
CALL METHOD lo_pers_manager->delete
EXPORTING
* scope = 1
config_key = lv_config_key
* transport_personalization =
* trkorr =
receiving
success = lv_bool.
.
.
Thanks,
Aditya.
Usiing the interface controller object, IWCI_SALV_WD_TABLE, get the WD_GET_API refernce where in GET_PERSONALIZATION_MANAGER method is used to get the personalization object. You can use this reference and get the settings for the ALV. You can use methods to delete or reset the personalization settings.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
86 | |
10 | |
10 | |
10 | |
7 | |
6 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.