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

Authority check program

Former Member
0 Likes
928

Hi friencds,

I am using authority check fo r standard Tcode ME21N fo r Tax Code "YA". I am successfully able to authorise user but i am not able to restrict the user for "YA". I mean whatever taxcode i am taking it gives me the same error "NO AUTHORISATION.".

I need to restirct this to on

8 REPLIES 8
Read only

SuhaSaha
Product and Topic Expert
Product and Topic Expert
0 Likes
865

Are the roles maintained correctly ? What is the auth. object you are using to achieve this restriction ?

BR,

Suhas

Read only

Former Member
0 Likes
865

Yes.. I am getting sy-subrc = 0 for the specific user. and sy-subrc = 12 for other users.

am sending you the code i used.


initial declaration
 DATA : p_mwskz TYPE mseg-mwskz VALUE 'YA'.
.
.
.
IF pqid-mwskz ne ' '.
   AUTHORITY-CHECK OBJECT 'Z_TAXCODE'
           ID 'MWSKZ' FIELD 'YA'"P_MWSKZ
           ID 'ACTVT' FIELD '*' .

  IF SY-SUBRC = 0.
    MESSAGE 'NO AUTHORIZATION' TYPE 'E'.
  ENDIF.
 endif.

Read only

SuhaSaha
Product and Topic Expert
Product and Topic Expert
0 Likes
865

You have coded it incorrectly my friend

IF pqid-mwskz ne ' '.
   AUTHORITY-CHECK OBJECT 'Z_TAXCODE'
           ID 'MWSKZ' FIELD 'YA'"P_MWSKZ
           ID 'ACTVT' FIELD '*' .
 
  IF SY-SUBRC NE 0. "Change this 
    MESSAGE 'NO AUTHORIZATION' TYPE 'E'.
  ENDIF.
 endif.

Cheers,

Suhas

Read only

Former Member
0 Likes
865

Hey suhas ,

It wont work as for any Tax Code its showing sy-subrc = 0.

I want user not to use the Tax Code YA .

Read only

SuhaSaha
Product and Topic Expert
Product and Topic Expert
0 Likes
865

>

> It wont work as for any Tax Code its showing sy-subrc = 0.

> I want user not to use the Tax Code YA .

Hello,

You have to ask your Basis guys to maintain this auth. object in the correct role & assign the proper tax codes to it.

Once the role(s) have been maintained successfully you can check if the auth. check is working correctly.

BR,

Suhas

Read only

Former Member
0 Likes
865

Hey guys,

Thanks for our views.

I got my result. Actually i should have not used P_MWSKZ here.

I used pqid-mwskz which picked my value and gave me error for YA.

Thankx.

Sany..

Read only

Former Member
0 Likes
865

Hi Santosh,

Did you check Transaction SU53 to see failed authorization ?

This might help you.

Regards

Read only

0 Likes
865

Hi srikanth ,

I checked in SU53 and it's showing.

The last authorization check was successful