cancel
Showing results for 
Search instead for 
Did you mean: 

Manage ALV format : if_salv_wd_table_settings~set_design

Former Member
0 Kudos

Hello


I display some data in a ALV table, which works fine. However I try to customize.

I use the configuation model  cl_salv_wd_config_table in View method DDOINIT, where so e.g. I like to have table design as 'alternating' and as default. .

My code is as following:

* GET the ALV configuration model

* instantiate component ALV
  data lo_cmp_usage type ref to if_wd_component_usage.

  lo_cmp_usage =   wd_this->wd_cpuse_alv( ).
  if lo_cmp_usage->has_active_component( ) is initial.
    lo_cmp_usage->create_component( ).
  endif.

* Get the model from use ALV controller
  data lo_interfacecontroller type ref to iwci_salv_wd_table .
  lo_interfacecontroller =   wd_this->wd_cpifc_alv( ).

    data lv_value type ref to cl_salv_wd_config_table.
    lv_value = lo_interfacecontroller->get_model( ).


*------------------------------------------------------------------
* Display and format of ALV grid

*Set design of ALV Table ' alternating color'
  lv_value->if_salv_wd_table_settings~set_design( value = cl_wd_table=>e_design-alternating ).

*---------------------------------------------------------------

My issue:

Some how the default values (standards) in the applikation overwrites the above coding ( see picture bellow). Sure I can change afterwards in the settings bellow. Hovever I like to make 'alternating'  as default when initiating.

So please have you a good advice, what I could do better so it works as intented.

Best regards

Christian

Accepted Solutions (1)

Accepted Solutions (1)

ramakrishnappa
Active Contributor
0 Kudos

Hi,

The readonly property of table needs to be set.

Pls add the below code.

lv_value->if_salv_wd_table_settings~set_readonly ( abap_true).


Hope this helps you.


Regards,

Rama

Former Member
0 Kudos

Hello Rama

I did, what you have proposed.

Hover the strange thing is, that the application is working as intended, when my colleague is starting it- another user-.

It seems, as I would have some personel presettings in the standard view.

Do you have any idea?

Thanks already for your valuable inputs above.

Best regards

Christian


ramakrishnappa
Active Contributor
0 Kudos

Hi Christian,

Okay, it seems that you have user settings for alv component.

You have to reset those settings.

Please refer my answer in the below thread.

Hope this resolves your issue.

Regards,

Rama

Former Member
0 Kudos

Hello Rama

You are genius. It is exactly what happened and I deleted the entries through  WD component WD_ANALYZE_CONFIG_USER.

Thanks a lot fro your time and excellent idea and solution

Christian

ramakrishnappa
Active Contributor
0 Kudos

You are welcome

Answers (1)

Answers (1)

former_member184578
Active Contributor
0 Kudos

Hi,

From the screenshot, I can see that you used sorting on a column. Did you write some code in WDDOMODIFYVIEW method to set sorting on that column?

Regards,

Kiran