cancel
Showing results for 
Search instead for 
Did you mean: 

Clear config model in ALV

FLSaito
Participant
0 Kudos

Hi,

i'm developing an application that uses ALV component as a result table. My screen has a radio button wich the user select the search criteria to display the results on ALV, depending on the value selected in the radio button the aggregation/totals/subtotal for the fields in the ALV are different. The problem is that when i show the ALV for the second time the aggregation/totals/subtotal rules still there, i need to reset the config model to default to set it again. How can i achieve that !? i tried using the following methods without success.

lr_comp_if_alv = wd_this->wd_cpifc_alv_result( ).

lr_config = lr_comp_if_alv->get_model( ).

cl_salv_wd_model_table_util=>CLEAR_CONFIGMODEL( value = lr_config ).

{/code}

thanks and regards,

Saito

Accepted Solutions (0)

Answers (3)

Answers (3)

FLSaito
Participant
0 Kudos

thanks everyone...

i solved the problem changing the param "only_if_new_descr" to ABAP_FALSE in the methdo SET_DATA( ) like the following code:


lo_interfacecontroller->set_data(
    only_if_new_descr = abap_FALSE
    r_node_data       = lo_nd_nd_alv_result ).

Saito

Edited by: fabio saito on Jun 22, 2010 7:59 PM

FLSaito
Participant
0 Kudos

Hi Chinnaiya,

i'm using the following code when i display the ALV but it keeps not reseting/refreshing the old model config:


* ALV Component Usage
  lr_comp_alv = wd_this->wd_cpuse_alv_result( ).
* Create component if not exist
  if lr_comp_alv->has_active_component( ) is initial.
    lr_comp_alv->create_component( ).
  endif.
  lr_comp_if_alv = wd_this->wd_cpifc_alv_result( ).
* Configure ALV
  lr_config = lr_comp_if_alv->get_model( ).
***
  data ls_config type if_salv_wd_table=>s_type_param_refresh_in.
  ls_config-dummy = if_salv_wd_table=>default.
  lr_comp_if_alv->refresh( in = ls_config ).
***
* Set configuration as pop-up
  lr_config->if_salv_wd_std_functions~set_dialog_settings_as_popup( abap_true ).
* Table Header
  lr_config->if_salv_wd_table_settings~r_header->set_text( 'Média Horas de Treinamento' ). "#EC NOTEXT
* Standard ALV Functions
  cl_salv_wd_model_table_util=>if_salv_wd_table_util_stdfuncs~set_all(
    r_model = lr_config
    allowed = abap_true ).

  cl_salv_wd_model_table_util=>if_salv_wd_table_util_stdfuncs~set_group_edit(
    r_model = lr_config
    allowed = abap_false ).

thanks

Former Member
0 Kudos

Hi ,

Try Refresh Method insted of clear config model and see ..

data:
    lr_available_usage type ref to if_wd_component_usage,
    lr_ic_available    type ref to iwci_salv_wd_table,
    lr_table_settings  type ref to if_salv_wd_table_settings,
    l_in               type if_salv_wd_table=>s_type_param_refresh_in.

*... alv component usages
  lr_available_usage = wd_this->wd_cpuse_available( ).
  if lr_available_usage->has_active_component( ) is initial.
    lr_available_usage->create_component( ).
  endif.
lr_ic_available = wd_this->wd_cpifc_available( ).
lr_table_settings ?= lr_ic_available->get_model( ).

  lr_ic_available->refresh( in = l_in ).

Regards

Chinnaiya P