Application Development and Automation 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: 
Read only

Querying the ACL database table

Former Member
0 Likes
696

Hi,

1) I want to query the psacl_tab database table with following conditions:

a) AUTH_USER = sy-uname

b) AUTH_USER_GRP = the user groups of the current user logged in

( say it is in internal table it_usrgrp - 3 entries )

c) AUTH_ORG = the current user's org units

( say it is also in internal table it_org - 2 entries ).

How can I write the query for the above one?

2) Also, suggest how can I get the current user's AUTH_ORG.

Thanks & Regards,

SAP Lover

1 REPLY 1
Read only

Former Member
0 Likes
551

Hi,

Take One "i_temp" internal table which is having both 'it_usrgrp' and

"it_org" fields.Means

LOOP AT it_usrgrp.

READ TABLE it_org WITH KEY commn fields = it_usrgrp-key

field.

IF sy-subrc EQ 0.

MOVE both internal table fields to i_temp.

APPEND i_temp.

ENDIF.

ENDLOOP.

SELECT required fields

INTO TABLE i_psacl_tab

FROM psacl_tab

FOR ALL ENTRIES IN i_temp

WHERE AUTH_USER = sy-uname AND

AUTH_USER_GRP = i_temp-AUTH_USER_GRP AND

AUTH_ORG = i_temp-AUTH_ORG.

2. READ TABLE i_temp with key AUTH_USER = sy-uname.

i_temp-AUTH_ORG will have the current user's AUTH_ORG.