Skip to Content
0
Former Member
Oct 25, 2007 at 07:33 PM

FM RSSB_GET_AUTHS_FILTERED: Code Help

62 Views

Hello Friends. Please help me on this. We have certain

Authorization Role 1

Company Codes

Authorization like BM01,BM64,BM89. and certain Consolidation Units 000, 9999 , 8999, 7878

Authorization Role 2

Also we have Company Code BM84 Which authorize mapped to certain Consolidation Units 7777, 3777 in rsec admin and both

But now

Authorization Role 1 and Authorization Role 2 which is assigned to USER1

NOW When user execute the report with all Comp Code he get No authorization error BM01,BM64,BM89, BM84.

beacuse it checks BM84 against all 000, 9999 , 8999, 7878 7777, 3777 and it complaints that user not authorized for 000, 9999 , 8999, 7878

I found the oss note 557924 and 668520 which suggest to implement the FM

RSSB_GET_AUTHS_FILTERED. But I am not sure what to Code here.

Please revise my code and explain me how this will work

CASE I_VNAM.

WHEN 'ZVATH_VAR'. *** Authorization variable for Company Code in Report

IF I_STEP = 1.

TYPE-POOLS:RSR.

DATA: L_UNAME TYPE SYUNAME VALUE 'USER1'.

DATA: L_T_RANGE_FILTER TYPE RSR_T_RANGESID,

L_S_RANGE_FILTER TYPE RSR_S_RANGESID,

L_T_RANGE TYPE RSR_T_RANGESID.

L_S_RANGE_FILTER-SIGN = 'I'.

L_S_RANGE_FILTER-OPT = 'EQ'.

L_S_RANGE_FILTER-LOW = 'BM84'.

APPEND L_s_RANGE_FILTER to L_T_RANGE_FILTER.

CALL FUNCTION 'RSSB_GET_AUTHS_FILTERED'

EXPORTING

I_IOBJNM = 'COMP_CODE'.

L_T_RANGE_FILTER = l_T_RANGE_FILTER.

*L_CLEAR = RS_C_TRUE.

L_UNAME = l_uname.

*EXCEPTIONS

*

*NOT_AUTHORIZED = 1

*INTERNAL_ERROR = 2

*USER_DOESNT_EXIT = 3

*

*X_MESSAGE = 4

*IF SY-SUBRC<>0.

*

ENDIF.

IF I_STEP = 2.

CALL FUNCTION 'RSSB_GET_AUTHS_FILTERED'

EXPORTING

I_IOBJNM = 'ZCONSUNIT'.

L_UNAME = l_uname.

IMPORT

E_T_RANGE = L_T_RANGE

*EXCEPTIONS

*

*NOT_AUTHORIZED = 1

*INTERNAL_ERROR = 2

*USER_DOESNT_EXIT = 3

APPEND L_s_RANGE to E_T_RANGE.

ENDIF.

Thanks

Regards

Soniya