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

Authorization Object

Former Member
0 Likes
724

Hello Friends ,

I have an requirement to check the authorization for FILENAME for activities 33 and 34. and some other field like bsart for 03 and 08..for this i have created auth object with these fields...and supllying these activities like

ID 'FILENAME' FIELD '33'

ID 'FILENAME' FIELD '34'

ID 'BSART' FIELD '03'

ID 'BSART' FIELD '08'

is it correct? and how it works can you please explain...

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
668

hI

The first problem is to understand hiw your object is, I don0t believe u have placed the sames fields twice.

After creating the object, u need to assign it to profile and inseret the values valid for that profile.

So in your program u should have:

AUTHORITY-CHECK OBJECT '<object>'
         ID '<field1>' FIELD '......'
         ID '<field2>' FIELD '.....'.

After checking the authorization u need to check SY-SUBRC: if it's not equal to zero, it means the user is not authorized

Max

5 REPLIES 5
Read only

Former Member
0 Likes
669

hI

The first problem is to understand hiw your object is, I don0t believe u have placed the sames fields twice.

After creating the object, u need to assign it to profile and inseret the values valid for that profile.

So in your program u should have:

AUTHORITY-CHECK OBJECT '<object>'
         ID '<field1>' FIELD '......'
         ID '<field2>' FIELD '.....'.

After checking the authorization u need to check SY-SUBRC: if it's not equal to zero, it means the user is not authorized

Max

Read only

0 Likes
668

Yes max,

if for the same field i have to check 2 values then how i should do ?thats y i repeated the same field to check for those 2 values..if it is not correct then how i should do...?

Read only

0 Likes
668

hI

After creating an object, it can assign more tham 1 value to a field of the object in the profile, if a user is authorized to all values an asteric is assigned instead of the values.

That means it doesn't need to repeat the same field in the objrct.

Anyway u should explain what u need to do? what's your object for?

Max

Read only

0 Likes
668

Hi,

If the combination of values for FILENAME and BSART is not important you will need to preform four checks;


AUTHORITY-CHECK OBJECT <your_object>
ID 'FILENAME' FIELD '33'.
IF SY-SUBRC = 0.
  AUTHORITY-CHECK OBJECT <your_object>
  ID 'FILENAME' FIELD '33'.
  IF SY-SUBRC = 0.
    AUTHORITY-CHECK OBJECT <your_object>  
    ID 'FILENAME' FIELD '33'.
    IF SY-SUBRC = 0.
          AUTHORITY-CHECK OBJECT <your_object>  
          ID 'BSART' FIELD '03'

etc.....

If the combinations of FILENAME and BSART are important then you will need to check each required combination.

Regards,

Nick

Read only

Former Member
0 Likes
668

This message was moderated.