cancel
Showing results for 
Search instead for 
Did you mean: 

Security on buttons in WDN ABAP

Former Member
0 Kudos

Good day,

I have been given a requirement to add security on Buttons in a Webdynpro View. Some users should be able to access only button 1, other users button 2 and so on.

Is this scenario possible. I realise this is related to security and I am posting this question in that forum as well. I just wanted to check if anyone working with Webdynpro ABAP have had such a requirement.

Kind regards, Liz

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

You can also term it as personalization and role based access to the user.

Easier and code - less way to achieve this would be to create 2 different component configurations, in these configurations make the buttons visible invisible as per your requirements.

Now embed these component configurations to 2 newly created application configurations for the WD application in use.

Once you have two different application configurations, then you pass the corresponding URL's with respective appl configuration mentioned in it to the desired user.

http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/b52e13c3-0901-0010-8fa6-d11a51821...

Regards

Manas Dua

Edited by: Manas Dua on May 25, 2010 9:06 AM

Former Member
0 Kudos

Thank you for your suggestions. I wll work on it and get back to you shortly.

Kind regards, Liz

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi Liz this is possible, as you mentioned it depends on the security let say for instance you have an authority_check( ).

If you pass the authority_check it means the user has access to the button 1 and not the button 2, but if you do not pass the authority_check then the user dont have access to button 1 but it does to button 2, right?

this is my way to do it maybe there's another way.

I'll find a data element in SE11 that is CHAR1 = X or space ' '.

then I will go to the webdynpro component controller and in the context node I will define an attribute type "the data element that you find already", I will name the attribute ENABLE_1 in your context node and ENABLE_2.

then you will need to go to your view and MAP the attribute from the context node to your VIEW. (now you have the attribute ENABLE_1 and ENABLE_2 available in your VIEW)

then you go to the LAYOUT tab in the layout tab you will add BUTTON 1 & 2 ,etc....

in the buttons there's properties of the buttons (once you add the button if you navigate to the low right corner it will display there) there's a property that is VISIBLE in the property there's a dropdown I believe the options are VISIBLE and NONE but you will ignore the dropdown and you will click next to the dropdown to BIND your attribute ENABLE_1 to button 1 and then samething with button 2 you will bind ENABLE_2.

now the attribute ENABLE_1 and ENABLE_2 are the one that decide the visibility of the button 1 and button 2 (if you want the button to be visible but not enable then you need to do instead of VISIBLE the same in the enable property of the button)

in your code (I will recommend WDDOINIT) you will code the IF statement...

let say is the authority_check().

IF the user has authority to see button 1.

you will get the WIZARD (READ, SET, APPEND, AS TABLE OPERAND, etc )and you will click on the SET option and select the attribute ENABLE that you created at the beginning and you will put SET_ATTRIBUTE( name = 'ENABLE_1' VALUE = 'X' ).

Same thing but this time you will need to do SET_ATTRIBUTE_NULL( name = "ENABLE_2" )

Else * the user dont have authority to see button 1 but it can see button 2.

SET_ATTRIBUTE( name = 'ENABLE_2' VALUE ='X').

SET_ATTRIBUTE_NULL( name = 'ENABLE_1')

ENDIF.

I hope this help!

Please provide point if is helpful

thanks!

Jason PV