Skip to Content
author's profile photo Former Member
Former Member

issue reg running a program

have created an object class using su21,

then by double clickingit i have created an auth object,with auth field actvt and werks and permitted values as all.

then i went to pfcg, i created a role and then a profile,then i clicked change auth data -then i selected do not select templates and then i added manually my auth object , i have given a plant and actvt as full auth

and generated a profile and then in the user tab i gave my userid, and i comapree it

everything looks in green

now i called the authcheck in my as

AUTHORITY-CHECK OBJECT 'ZFT'

ID 'ACTVT' FIELD '02'

ID 'WERKS' FIELD 'ABC'.

if sy-subrc eq 0.

write : SY-UNAME , 'Suceess ZFT'.

else.

write:/ SY-UNAME , 'Fail ZFT'.

endif.

Q1) DOES IT CHECK WITH SY-UNAME

I HAVE AUTH TO ME WHEN I RUN THE PRGM UNDER MY LOGIN I GET SUCESS (SY-SUBRC EQ 0)

Q2)WHEN I RUN THE SAME UNDER A DIFFERENT LOGIN THE O/P IS FAIL ZFT

SO FAR ITS WORKING FINE BUT FOR THIS CONDITION I AM GETTING A SY-SUBRC OF 12 WHICH SHOULD BE 4 AS PER THE HELP DOCUMENT

· 0: The user has an authorization for all specified values.

· 4: The user does not have the authorization.

· 8: The number of specified fields is incorrect.

· 12: The specified authorization object does not exist.

DO LET ME KNOW IF IAM MISSING ANYTHING.

Q3) INSTEAD OF THIS CAN I USE S_PROGRAM. LET ME KNOW WHAT EXACTLY IT DOES.

THANKS

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

1 Answer

  • Best Answer
    author's profile photo Former Member
    Former Member
    Posted on Jan 10, 2007 at 07:47 PM

    Hi

    If sy-subrc has value 12 it means the user hasn't that authorization object, if it's 4, it means the user has the aut object but he hasn't the authorization.

    So if in my profile there's the object 'ZFT', if I've the authorizazion for plant ABC, sy-subrc'll be 0 else 4.

    If in my profile there isn't the object 'ZFT', sy-subrc'll be 12.

    Max

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.