cancel
Showing results for 
Search instead for 
Did you mean: 

Setting Inital View for ALV

Former Member
0 Kudos

Hi,

I have created a number of views (stored as configuration data records) for an ALV.

Can someone please tell me the best way to set the initial view for an ALV? We have a large number of users seperated into different roles using the ALV. I would like to specify a different intial view for each role and then turn off the view dropdown list so the users cannot change it. I know how to not show the dropdown list, but I am having trouble setting the intial view. Please help.

Thank you.

Tara

Accepted Solutions (0)

Answers (3)

Answers (3)

Former Member
0 Kudos

Thanks for the help with turning off the view list dropdown on the ALV, but do you know how to specify the value in the view drop down list before you hide it???

Thanks

Former Member
0 Kudos

Hi,

In the latest versions, I'm not able to see the other values in dropdpwn except standard view.

When you check the interface if_salv_wd_std_functions, then you can find some methods

IS_VIEW_LIST_ALLOWED, IS_HIERARCHY_ALLOWED, SET_VIEW_LIST_ALLOWED,SET_HIERARCHY_ALLOWED you have to play around these 4 methods to have the other default values to be set to the dropdown. In this interface you dont find any dropdown list values to be set. You have to do by using the above four methods I guess. Even I didnt try them out.

The default value is standard view by default.

Regards,

Lekha.

Former Member
0 Kudos

Thanks for your response, however, I am not taking about Web Dynpro Views. I am taking about ALV views. I want to display a different "Standard View" for each user role. I have created the views using configuration and they appear in the drop down list on the ALV, however, I want to use a different one of these views as the default view of the ALV depending on the user that is logged in. I can then hide the drop down so it cannot be changed by the user. Can anyone help me with this please?

Thank you.

Former Member
0 Kudos

Hi,

Sorry for that earlier reply.

Please try out this way -

For that ALV and as per the user role set the ALV settings like this -

DATA: lr_functions type ref to IF_SALV_WD_STD_FUNCTIONS.
  lr_functions  ?= lr_model.         "Model object for ALV

lr_functions->set_view_list_allowed( abap_true ).
lr_functions->SET_HIERARCHY_ALLOWED(abap_true).

Regards,

Lekha.

Former Member
0 Kudos

Hi,

If you want to share the same View with enabling/disabling some UI elements as per the user then set them accordingly in the MODIFYVIEW.

If you want to show different initial views for different users then there should be some change in the business functionality.

If you want to disable/enable dropdown as per user then you can still share the same view to all the users by coding the enable/disable or other UI elements properties in the MODIFYVIEW.

Let me know your exact requirement.

Regards,

Lekha.