Application Development 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: 

AUTHORITY-CHECK & customized program

Former Member
0 Kudos
73

Hi,

I've applied an authority-check to my customized program. What I did was, I've created an authorization object name 'ZFI_PGRM' in SU21 and tie it with authorization fields BUKRS, ACTVT. This authority-check will validate on the company code (BUKRS) entered from the selection screen. Below are my lines in the customized program :

DATA: text TYPE string,

m_text TYPE string.

text = 'You are not authorised for Company Code'.

DATA: t_t001 LIKE t001 OCCURS 0 WITH HEADER LINE..

SELECT * FROM t001

INTO TABLE t_t001

WHERE bukrs IN s_bukrs.

LOOP AT t_t001.

AUTHORITY-CHECK OBJECT 'ZFI_PGRM'

ID 'BUKRS' FIELD t_t001-bukrs

ID 'ACTVT' FIELD '03'.

IF sy-subrc <> 0.

CONCATENATE text t_t001-bukrs INTO m_text SEPARATED BY space.

ENDIF.

ENDLOOP.

At the same time BASIS tie the autorization object 'ZFI_PGRM' to the user role in order to access the program using PFCG. The problem now is the result that I'm getting always SY-SUBRC = 12 eventhough the user is allowed to access the company's report. Please help...

Haryati

1 ACCEPTED SOLUTION

former_member378318
Contributor
0 Kudos
48

Run transaction SU53 after the auth check fails and maybe it will give you a clue as to what is going on.

1 REPLY 1

former_member378318
Contributor
0 Kudos
49

Run transaction SU53 after the auth check fails and maybe it will give you a clue as to what is going on.