09-21-2006 9:15 PM
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.
09-21-2006 9:27 PM
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
09-21-2006 9:27 PM
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
09-21-2006 9:34 PM
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
09-21-2006 9:56 PM
Hi
Try to see the table UST12, here you can find the values of the object in certain authorizazion.
Max
09-21-2006 10:00 PM
Thanks Max, that is another way that we could approach this solution. I appreciate your feedback.
09-21-2006 10:01 PM
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