Display default view based on the authorization
My requirement is only few users will have authorization to WD ABAP application.
If user do not have authorization then only message will be displayed, no view contents will be displayed.
I my application, there are 2 views in a window.
So I am checking the authorization in inbound plug of main window and accordingly message is displayed but
eventhen first view is being displayed.
How to resolve the issue.
Thanks, in advance
Here are few options for you
1) Using a dummy view :
a) Create a dummy view, make it as a default view b) Check the authorization in WDDOINIT method of Component Controller c) If user is not authorized then,you can use the dummy view to display error message "You are not authorized to access this Application" b) create 2 Out bound plugs for 2 views from dummy view, if user is authorized then navigate accordingly
2) To handle without creating a dummy view
a) Create an attribute of type WDY_BOOLEAN in component controller named "UI_VISIBLE" b) Check the authorization in WDDOINIT method of Component Controller i) If user is authorized set "UI_VISIBLE" with value "ABAP_TRUE" ii) If user is NOT authorized set "UI_VISIBLE" with value "ABAP_FALSE" c) Map the UI_VISIBLE to your default view and bind UI_VISIBLE to visible property of ROOTUIELEMENTCONTAINER d) Generate REPORT_ERROR_MESSAGE in the WDDOINIT method of the default view to show the error message (Even if you hide the ROOTUIELEMENTCONTAINER, still you can show the error message) e) If you want to navigate to second view then based on the authorization use out bound plug to navigate in the WDDOINIT method of the default view
This post is extension of Chris reply
Thanks and Regards