2008 Dec 09 7:47 AM
Hi,
i write a abap (protokol) which shell be started every hour. In this report i will use
an AUTHORITY-CHECK for an defined user, because i will send the protokol via email, but i have
to check if this user is allowed to see the data.
I will use this:
AUTHORITY-CHECK OBJECT 'F_LFA1_BEK'
ID 'BRGRU' FIELD '__________'
ID 'ACTVT' FIELD '__________'.
for an defined user.
Is this possible, or how can i check this in another way?
Thanks.
Regards, Dieter
2008 Dec 09 8:07 AM
pls. have a look at FM AUTHORITY_CHECK. This is for basically authorization check where user >< sy-uname (if my understanding is right, this is what you need)
2008 Dec 09 7:55 AM
hi,
you can define authority check in your program in
at selection screen event and define the authorization object
in user role or profiles with values maintained with the help of
basis people.
This will restrict users from seeignthe data for which they are
not authorised.
2008 Dec 09 8:10 AM
Hi Gautham,
thanks for your answer, but i don't want to use the authority-check for the user who
starts the report, i want to chech the authority for a specific user, because the
report will be start in batch.
Example: i read all entries from LFA1. Then i will check if user A has the authority to see the data
then he gets a protocol. If not, then no protocol.
Regards, Dieter
2008 Dec 09 8:07 AM
pls. have a look at FM AUTHORITY_CHECK. This is for basically authorization check where user >< sy-uname (if my understanding is right, this is what you need)
2008 Dec 09 8:57 AM
Hi Eric,
i tried it like this:
UTHORITY-CHECK OBJECT 'F_LFA1_BEK'
ID 'BRGRU' FIELD 'KRED'
ID 'ACTVT' FIELD '03'.
*
BREAK-POINT.
*
CALL FUNCTION 'AUTHORITY_CHECK'
EXPORTING
NEW_BUFFERING = 3
USER = SY-UNAME
OBJECT = 'F_LFA1_BEK'
FIELD1 = 'BRGRU'
VALUE1 = 'KRED'
FIELD2 = 'ACTVT'
VALUE2 = '03'
EXCEPTIONS
USER_DONT_EXIST = 1
USER_IS_AUTHORIZED = 2
USER_NOT_AUTHORIZED = 3
USER_IS_LOCKED = 4
OTHERS = 5.
*
BREAK-POINT.
at first breakt-point sy-subrc = 0 at second sy-subrc = 2. Can you tell why i get another sy-subrc?
is my FM-Call correct?
thanks.
Regards, Dieter
2008 Dec 09 9:12 AM
this is absolutely OK, the FM comes back with sy-subrc = 2 if the user is authorised (just check the source code of the FM, there is another FM call (at the end) and after that the sy-subrc is set to 2 if everything is OK)
2008 Dec 09 9:26 AM
Hi Eric,
sorry for my stupid question (better i read more exactly). In FM is USER_IS_AUTHORIZED = 2.
Thanks, you solved my problem.
Regards, Dieter
2008 Dec 09 8:11 AM
It's possible. You need to create a Profile for every User with this Object 'F_LFA1_BEK'.