cancel
Showing results for 
Search instead for 
Did you mean: 

Reset the User Settings

former_member183073
Active Participant
0 Kudos

Hi Experts,

Can anyone suggest how to reset the User Settings through code, the requirement is to reset all the Columns of a table in initialization, the problem is if the user is changing the layout of the column i have to allow the change but need to reset all the columns when he reopens the application again i have to reset the columns

Accepted Solutions (0)

Answers (2)

Answers (2)

ramakrishnappa
Active Contributor
0 Kudos

Hi Syed,

Its not happening just for you.... its the same for all

As soon as we make any changes to layout in the application, these are captured under USER SETTINGS. Hence, it is loaded for that user on further run of application. It is the feature of personalization given to the users.

Yes, we can reset the user settings.

Steps:

  1. Open WD component WD_ANALYZE_CONFIG_USER
  2. Run the WD application WD_ANALYZE_CONFIG_USER, it displays the user personalization settings
  3. Select the lines related to your user & your component and press DELETE button

Please refer my answer in the below thread.

Hope this helps you.

Regards,

Rama

former_member183073
Active Participant
0 Kudos

thanks Rama,

that helps me in manually deleting the settings, i will analyse the object and try to put the code for deleting the settings in my object.

ramakrishnappa
Active Contributor
0 Kudos

Hi Syed,

To delete the user settings programmatically,

Please write the below code in wddomodifyview( ) method


  IF first_time = abap_true.


    "get component name.
    DATA lv_cmp_name TYPE string.
    lv_cmp_name =
    wd_comp_controller->wd_get_api( )->get_component_info( )->name.

    DATA lt_wdy_conf_data TYPE TABLE OF wdy_conf_user.


    SELECT *
    FROM wdy_conf_user
      INTO TABLE lt_wdy_conf_data
    WHERE wduser = sy-uname AND
          user_id = 'U' AND
          component_name = lv_cmp_name.

    DELETE wdy_conf_user FROM  TABLE lt_wdy_conf_data.

  ENDIF.

Note: This wil not let you save the user settings for your component. It always resets the user settings when you start application

Hope this should meet your requirement.

Regards,

Rama

AntonR
Explorer
0 Kudos

Hi Rama,

thanks for posting you solution.

The problem is that it will be applied only after the next start.

Is there any solution to apply this in the current session.

Thanks in advance,

Anton

former_member222068
Active Participant
0 Kudos

Hi Syed,

can you elobare the your query. what do you mean by resetting columns. Do you want to allow the user to hide / show columns.

Thanks & Regards,

Sankar Gelivi

former_member183073
Active Participant
0 Kudos

The user will be moving the columns from one position to another like a column in position 5 can be moved to position 2, i have to allow the user to change the position of the columns but when the user opens the application again i have to show the columns as they were displayed initially the column 5 in position 5. hope this helps

former_member222068
Active Participant
0 Kudos

Hi Syed,

For this no coding is required, SAP has provided drag and drop functionality.

Drag column 3 to column 1.

if you refresh the application. column will be at there original positions. We dont have fixed positions for the columns.

Postion of the column cannot be changes programitically, because we dont have that option. At this point of time, only drag and drop functionality is provided.

Thanks & Regards,

Sankar Gelivi

former_member183073
Active Participant
0 Kudos

Hi Sankar,

Not sure why it is happening to me, if i drag the column and restart the application then also the column in being in the latest position not in initial. and this is a table not alv

former_member222068
Active Participant
0 Kudos

Hi Syed,

I have noticed. This should be reported to SAP. Nothing can be done from our end.

Thanks & Regards,

Sankar Gelivi