‎2005 May 17 11:31 AM
Hi Experts!
I have created a table maintenance for a custom table which contain a field VKORG(Sales Org). In this table user should be able to edit / diplay data according to the sales organisation and users authority lavel. Example: USER1 may have access to edit Sales Org. 1001 data and will be not able to maintain data for Sales Org. 1002 data. Is it possible to do using authorization object ? If Yes, How?
Thanks in advance for suggetion/advice.
Thanks,
Ask.
‎2005 May 17 11:49 AM
Hi,
You can try in this userexit:
USEREXIT_FIELD_MODIFICATION (LV69AFZZ)
You can also use authorization check to see if the user has access to edit the same:
CONSTANTS: lc_a(1) TYPE c VALUE 'A',
lc_activity TYPE tact-actvt VALUE '03'.
CALL FUNCTION 'SD_COND_AUTH_CHECK'
EXPORTING
i_kschl = komv-kschl
i_kvewe = lc_a
i_kappl = komk-kappl
i_activity = lc_activity
EXCEPTIONS
no_authority = 1
OTHERS = 2.
There are other FM like:
AUTH_CHECK_TCODE
VIEW_AUTHORITY_CHECK
Check there FM and see which ones suits you the most.
Regards,
Anjali.
‎2005 May 17 12:08 PM
Hi Anjali,
Thanks for reply.
Is there any way to do this without writing and code on table maintenance, as there is a risk of over writing when generating table maintenance for second time. Is it possible to get by configuring authorization object or by any means.
Rgds,
Ask
‎2005 May 17 1:21 PM
Hi Ashok,
To get the level of authority checking you want, you will have to change the maintenance screen. The authorisation object mentioned in an earlier post wont help you.
There are, however, events on the screen where you can put your code which are generally protected when you re-generate the maintenance screen.
Even if the code is lost, it is a simple case to reinsert (if you keep a copy).
Also the post which mentions a function module is a little off the mark, you will need to use the authority-check keyword directly.
Hope that helps.
Cheers,
Brad
‎2005 May 17 12:42 PM
Hi Ashok,
While generating table maintainance dialog for a table, there is a field for authorisation group. i have not used it myself but you can try creating an authorisation object, assingning it to a group and assigning that group to maintainance dialog.
Please let me know whether it is working or not.
Regards,
Komal.
‎2005 May 18 2:27 AM
I suggest that you use the events for view maintenance that are supplied to allow you to plug in your own code. The event number 25 is for additional authorisation checks and allows you to perform you own authorisation and return appropriate messages.
When in view maintenance you should be able to use the menu path ENVIRONMENT -> MODIFICATION -> EVENTS. Then in the event screen you use event 25. You place the name of the routine you wish to call and then of course create the necessary code. From the Event screen you can use HELP -> APPLICATION HELP to be a better overview on what you can do with the events.
This is similar to what Brad was suggesting but I got the impression he was saying you should modify the screen logic. Using events you can always re-generate the screens without having to re-implement your code. I haven't used this event so I am making some assumptions but have used other events to great effect.
Good luck.
Michael