Skip to Content

How my addon program can capture a license error exception

Nov 01, 2016 at 07:55 PM


avatar image
Former Member


I want my addon can capture error when a user tries to open a form which is not allowed under user's current license. I am using ActivateMenuItem() method to open a form from my addon, although I put the code inside a try/catch block but it doesn't capture the exception. According to SDK document, method ActivateMenuItem() should throws an exception when trying to activate system menu items which are disabled. Now SAP just display an error message in the system message log area saying "You cannot open window[60110] Service Call with your current license". My question is that is there a way to capture this error in my addon?



10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

1 Answer

avatar image
Former Member Nov 02, 2016 at 04:13 PM

Hi Lan,

Note that it throws when the item is disabled. Disabled does not necessarily mean that you don't have permissions.

You can have an enabled menu item and still not have permission to access a given form.

And it's also possible to have a disabled menu item, and have permission to access a form.

To obtain the permission of a user for a given object you can use the SBObob.GetObjectPermission() method.

You can further manipulate permissions with UserPermissionTree, UserPermissionForms, UserPermission, and Users objects.

There is also a sample on permissions on the SDK Samples directory.

Pedro Magueija

LinkedIn | Twitter | Blog

10 |10000 characters needed characters left characters exceeded