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

simple logic problem in authorization object

Former Member
0 Likes
564

hi friends,

below is the code, i am working on authorization object.

i dont know why, for all the comp codes i enter it is

giving the same,

answer not authorized. it is not that the compcode

i am entering is not authorized, if i change the <> to = ,

then it is giving unrestricted data,

whether authorized or not authorized.

AUTHORITY-CHECK OBJECT 'F_BKPF_BUK'

ID 'ACTVT' DUMMY

ID 'BUKRS' FIELD P_FS.

IF SY-SUBRC <> 0.

ZZ_EXIT_BUKRS = 'Y'.

ENDIF.

IF ZZ_EXIT_BUKRS EQ 'Y' .

MESSAGE E999(ZI) WITH 'NO AUTHORITY TO EXECUTE PROGRAM.....!!!'.

ENDIF.

can some one help.

thanks

4 REPLIES 4
Read only

former_member194669
Active Contributor
0 Likes
511

Hi,

Whether you have auth for company code? please check thru RSUSR002. whether u have authorization to plant you are entering?

aRs

Read only

0 Likes
511

hi thank you for the reply,

but i have full access,

but id created for the user is not shown there.

so u mean that, there is a problem with authorization from basis people.

Read only

0 Likes
511

Hello Saritha,

You have to execute the program with other user login who does not have auth.

some times auth object will not work when you assign roles and profiles,you need logoff the system and relogin,then it should work.

anyhow check with debugging mode ,actvt is important field here.

Thanks

Seshu

Read only

jayanthi_jayaraman
Active Contributor
0 Likes
511

Hi,

Try by clear ZZ_EXIT_BUKRS .

AUTHORITY-CHECK OBJECT 'F_BKPF_BUK'

ID 'ACTVT' DUMMY

ID 'BUKRS' FIELD P_FS.

clear ZZ_EXIT_BUKRS .

IF SY-SUBRC <> 0.

ZZ_EXIT_BUKRS = 'Y'.

ENDIF.

IF ZZ_EXIT_BUKRS EQ 'Y' .

MESSAGE E999(ZI) WITH 'NO AUTHORITY TO EXECUTE PROGRAM.....!!!'.

ENDIF.