05-30-2011 12:18 PM
Hi all,
I'm new to authorization concepts. Actually we need to restrict the users for VA transactions based on Profit Center. I searched here, but i found for FI tcodes.
In SU24,the authorization object K_PCA has been activated. Functional people told that we need to code for mapping for VA tcodes.
Plz help me out for this.
Thanks in Advance,
Ramesh.
06-15-2011 8:49 PM
Ramesh,
Would it be possible to have the functional team configure and make the profit center and the Sales Org (VKORG) equal in config? Iu2019m curious because the Sales Org is a field thatu2019s check in most (if not all) VA transactions. I think that this would be easier.
06-15-2011 4:41 PM
Phew....thats some requirement
on first thoughts, i think the authorization object check can only partially help. you would still need to do some coding in the sales order user exit. The check and kicking the user out should be done at a optimum place such that first the relevant data is populated to make the check valid and then based on the outcome of the check, the user is allowed/disallowed. Safest bet for me on top of mind would be to exit the user just before saving the document.
the logic should be to check the account assignment tab in the header for the company code and then check for the relevant Controlling area and finally based on the controlling area a check could be made on the PRCT* tables to check for the user responsible and the profit centre group (or profit centre as you would like)
the suggestion is what i for a start wouldnt do in my system - it could make life quite complex.......
06-15-2011 8:49 PM
Ramesh,
Would it be possible to have the functional team configure and make the profit center and the Sales Org (VKORG) equal in config? Iu2019m curious because the Sales Org is a field thatu2019s check in most (if not all) VA transactions. I think that this would be easier.
06-16-2011 6:06 AM
Thanks.. Sorry i have done this..
In the Include MV45AFZB,
i have coded as below
FORM USEREXIT_MOVE_FIELD_TO_COBL USING US_VBAK STRUCTURE VBAK
US_VBAP STRUCTURE VBAP
CHANGING CH_COBL STRUCTURE COBL.
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""$"$\SE:(1) Form USEREXIT_MOVE_FIELD_TO_COBL, Start A
*$*$-Start: (1)---------------------------------------------------------------------------------$*$*
ENHANCEMENT 2 ZSD_AUTHR_CHECK_PROFITCENTER. "active version
*
data: lv_var(20).
concatenate 'PC' '1000' vbap-PRCTR into lv_var. " 1000 - Cost Center
IF vbap-PRCTR is not initial.
AUTHORITY-CHECK OBJECT 'K_PCA'
ID 'RESPAREA' FIELD lv_var
ID 'CO_ACTION' FIELD '*'
ID 'KSTAR' FIELD '*'.
IF sy-subrc <> 0.
message 'You are not authorized for this Profit Center' type 'E'.
ENDIF.
ENDIF.
ENDENHANCEMENT.