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: 

Help with Auth Checks for list of values

Former Member
0 Kudos

I am wondering if anyone out there has used authorization checks when pre-screening a list of values to present to an end user, and if so, how.

For example: We are creating an interface for end users that will allow them update certain pieces of an Invoice line item. When presenting the user with a drop-down list of Cost Centers we would like to be able to pre-screen the list and only display the list of values that the particular user is authorized to post to.

As of right now, the only way that I can think of to accomplish this is to loop through the list of possibilities and perform Auth Checks for each value and then flag them as display or not. Once that is done, loop through the table of results and display only the Cost Centers they have authorization in. This process seems pretty cumbersome and resource intensive. Does anyone else have a better way to go about this that I'm not considering?

Thank you in advance for your time.

Andy

p.s. Points will always be rewarded for helpful answers.

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Hi

I think your solution it's only available soultion if you want to use authorization-check stataments.

Another idea can be found out the cost center directly from the tables with the values of auth object.

Max

5 REPLIES 5

Former Member
0 Kudos

Hi

I think your solution it's only available soultion if you want to use authorization-check stataments.

Another idea can be found out the cost center directly from the tables with the values of auth object.

Max

0 Kudos

Max-

Can you tell me more about your suggestion of using the values of the auth objects directly from the tables? I've done some looking around and am having a hard time taking your recommendation to the next step.

I'm not married to the idea of using authorization-check statements, that was just the one way I was familiar with.

Thanks,

Andy

0 Kudos

Hi

Try to see the table UST12, here you can find the values of the object in certain authorizazion.

Max

0 Kudos

Thanks Max, that is another way that we could approach this solution. I appreciate your feedback.

0 Kudos

Hi

This fm return all values of certain object for a user:

SUSR_USER_AUTH_FOR_OBJ_GET:

DATA: USER_NAME LIKE USR02-BNAME,

SEL_OBJECT LIKE UST12-OBJCT VALUE 'K_CSKS'.

DATA: T_VALUES LIKE STANDARD TABLE OF USVALUES.

USER_NAME = SY-UNAME.

CALL FUNCTION 'SUSR_USER_AUTH_FOR_OBJ_GET'

EXPORTING

USER_NAME = USER_NAME

SEL_OBJECT = SEL_OBJECT

TABLES

VALUES = T_VALUES

EXCEPTIONS

USER_NAME_NOT_EXIST = 1

NOT_AUTHORIZED = 2

INTERNAL_ERROR = 3

OTHERS = 4.

IF SY-SUBRC <> 0.

MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

ENDIF.

In T_VALUES you should have all values you need and so show them.

Max