Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

Authorization on table maintenance

Former Member
0 Kudos

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.

5 REPLIES 5

Former Member
0 Kudos

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.

Former Member
0 Kudos

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

0 Kudos

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

Former Member
0 Kudos

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.

michael_bennett
Explorer
0 Kudos

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