‎2007 Nov 26 3:07 AM
How to check authorization for company code for a selet-option variable
Thank you
‎2007 Nov 26 3:14 AM
You need to take all the valid compnay codes into one internal table than call the AUTHORITY CHECK for every company code in that internal table.
Like:
SELECT BUKRS
INTO IT_BUKRS
FROM T001
WHERE BUKRS IN S_BUKRS
LOOP AT IT_BUKRS.
AUTHORITY-CHECK 'F_BUK' " << I am not sure about the object
FIELD IT_BUKRS-BUKRS
ACTIVITY '03' " <<
ENDLOOP.Regards,
Naimesh Patel
‎2007 Nov 26 3:34 AM
Hi pradeep,
Use authorization object <b>F_BKPF_BUK</b>.
Fetch all company codes into internal from select-options.
SELECT bukrs
INTO it_bukrs
FROM t001
WHERE bukrs IN s_bukrs.
Loop through ur internal table and check for authorization.
LOOP AT it_bukrs.
AUTHORITY-CHECK OBJECT 'F_BKPF_BUK'
ID 'BUKRS' FIELD it_bukrs-bukrs " passing internal table value
ID 'ACTVT' FIELD '03'. " u can pass required value
ENDLOOP.
check this link for more information:
http://help.sap.com/saphelp_nw04/helpdata/en/9f/dbaccb35c111d1829f0000e829fbfe/frameset.htm
I have considered <b>F_BKPF_BUK Accounting Document</b>: <b>Authorization for Company Codes</b>. This is an object in class Financial Accounting.
To refer other objects use TCODES SU20 for fields and SU21 for objects.
Reward me if useful,
Harimanjesh AN