‎2006 Aug 07 6:09 AM
Hi,
SELECT-OPTIONS: s_kostl FOR zstruct_kostl-kostl
NO-EXTENSION.
AUTHORITY-CHECK OBJECT 'K_CSKS'
ID 'KOKRS' FIELD '*'
ID 'KOSTL' FIELD s_kostl
ID 'ACTVT' FIELD '*' .
IF sy-subrc NE 0.
MESSAGE ID 'ZFI' TYPE 'E' NUMBER 34 WITH s_kostl.
ENDIF.
User has given the authorisation to run the cost center 511131311.
But it is showin the message like this.
Object K_CSKS CO-CCA: Cost Center Master
Object class CO Controlling
Field Value
Activity
*
Controlling Area
*
Cost Center
<b>IEQ0511131</b>
It is not allowing the user to xecute this cost center value.
Can I know what the problem will be?
Regards,
Beena
‎2006 Aug 07 6:37 AM
hi beena ,
1.first u have to get all the Cost centes which comes for the given range in selection scree.
select kokrs kostl from csks into i_kostl where kostl in s_kostl.2.Then u have to check like this
loop at i_kostl.
AUTHORITY-CHECK OBJECT 'K_CSKS'
ID 'KOKRS' FIELD '*'
ID 'KOSTL' FIELD i_kostl-kostl.
ID 'ACTVT' FIELD '*' .
IF sy-subrc NE 0.
MESSAGE ID 'ZFI' TYPE 'E' NUMBER 34 WITH i_kostl-kostl.
ENDIF.
endloop.Regards
Prabhu
‎2006 Aug 07 6:19 AM
Hi,
Have you added 'K_CSKS' to user profile? Before calling the authorization object , use below statement .
read s_kostl index 1.
AUTHORITY-CHECK OBJECT 'K_CSKS'
ID 'KOKRS' FIELD '*'
ID 'KOSTL' FIELD s_kostl-low
ID 'ACTVT' FIELD '*' .
IF sy-subrc NE 0.
MESSAGE ID 'ZFI' TYPE 'E' NUMBER 34 WITH s_kostl.
ENDIF.
Regards
Appana
‎2006 Aug 07 6:21 AM
I think you need to loop <b>s_kostl</b> and pick up each value for authorization check.
The selection-option <b>s_kostl</b> will have multiple value.
you can loop it
for each value moving to a temp variable.
pass the temp variable to authority check.
Rgds,
TM
‎2006 Aug 07 6:24 AM
hi,
For one value also it is not working.
yes, we have added this in the user profile.
‎2006 Aug 07 6:35 AM
Are you sure you have specified the check as s_kostl-low as Appana suggested above?
It sounds like the system takes the entire value of the select-option, IEQxxxx, instead of only taking the value xxxx, and that is where the check fails.
Please check for s_kostl-low.
Hope this helps.
Sudha
‎2006 Aug 07 6:37 AM
hi beena ,
1.first u have to get all the Cost centes which comes for the given range in selection scree.
select kokrs kostl from csks into i_kostl where kostl in s_kostl.2.Then u have to check like this
loop at i_kostl.
AUTHORITY-CHECK OBJECT 'K_CSKS'
ID 'KOKRS' FIELD '*'
ID 'KOSTL' FIELD i_kostl-kostl.
ID 'ACTVT' FIELD '*' .
IF sy-subrc NE 0.
MESSAGE ID 'ZFI' TYPE 'E' NUMBER 34 WITH i_kostl-kostl.
ENDIF.
endloop.Regards
Prabhu