cancel
Showing results for 
Search instead for 
Did you mean: 

Check authorization after selection in navigation bar

Former Member
0 Kudos

Hi,

there is a standard entry in the navigation bar "Create service ticket" that calls the view set SrvTViewSet for creation of service tickets. The viewset contains of four standard view areas, SrvtHead, SrvtBus, SrvtPartner, SrvtSLA. We have not modified the views themselves, only the IMPL- class for the SrvtHead since we have modfied methods in the class. The problem occurs when the user do not have the right authorization to create service tickets at all (after she has selected Create service ticket in the navigation bar), then an error message is created saying "Wrong authorization" but the four screens also dumps with message cx_sf_ref_is initial or an exemption has occurred in cx_bsp_element_exception.

First I tried to take care of the authorization check myself in each view of the four but then I thougt that this would not be the correct solution. Instead the user would get an error message when she selects "Create service ticket" in the navigation bar and an error message would appear before showing the Create service ticket view at all. Is this possible? There is two authorization objects created but the standard does not seem to work regarding the authorization check.

Is there anyone having any ideas?

Thank you and goodbye,

Lena

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

I think what you can do is , replace the Controller for the Navbar view CL_CRM_IC_NAVBARVIEW with your own Custom Class ( do a controller replacement in the Framework Profile )

Then Redefine the Method PROCESS_NAVIGATION_REQUEST

Inside this method , you can check what is the current Nav Link Clicked , if it is 'Create Service Ticket' , perform the Authorization check or whatever you want and if it not successful , raise a Error Message using below Code and have a RETURN statement .

data : lv_msgsrv type ref to cl_bsp_wd_message_service.

lv_msgsrv = cl_bsp_wd_message_service=>get_instance( ).

lv_msgsrv->add_message( ..... ) .

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi, thank you a lot, your solution solved my problem! /regards Lena