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

add authority check code to Query.

Former Member
0 Likes
549

Hi all

iam working at the company with several SITES , I built a sales query ( using marc-werks ) and i want to adjust the authority according to the sites .

for example :

employee X at SITE A can display the data for his site only .

for this issue a creat a new OBJECT (actvt , werk ) , and i creat a Z_PROGRAM , when I add the authority check code

to the Z_PROGRAM :

AUTHORITY-CHECK OBJECT 'M_IS_WERKS'

ID 'MCINF' FIELD '03'

ID 'WERKS' FIELD marc-werks.

check sy-subrc = 0.

but the query dosn't work and give the EMPLOYEE a authoraization error in su53

activity > 03

werks > ' '

I WANT THE QUERY DISPLAY THE SITE WHICH IS DETERMAINED IN THE OBJECT FOR EACH USER .

3 REPLIES 3
Read only

Former Member
0 Likes
489

any help plz .

Read only

0 Likes
489

Hi ,

I don't know that you already resolved this issue. Any way try creating custome Authorization for plant and use it

Create Z_IS_WERKS with following authorization fields and assign permited value '03' for field ACTVT.

ACTVT Activity

WERKS Plant

Use this code.

AUTHORITY-CHECK OBJECT 'Z_IS_WERKS'

ID 'ACTVT' FIELD lv_display

ID 'WERKS' FIELD zmapw-werks.

Regards,

Babu

Read only

Former Member
0 Likes
489

thx for your help but ,

when the use A at site X try to use the report he can't obtain any result and the authoraization error (su53 ) give that :

activite : 03

werks : ' '

note : I added the object in the user roll with this values

activity : 03

werks : X

Edited by: ahsd2000 on Feb 26, 2012 2:35 PM