**[ How to build an SAP security role matrix** ]

**This guide will show how to build an up to date SAP security role matrix of existing roles in an SAP system which can then be easily distributed to the business for review.**

- Create a test composite role: ZC_TEST using PFCG
- Assign all the required single roles. (e.g: Z*)

- Save
- Run transaction SUIM
- Transactions executable for role

- Enter ZC_TEST
- Get the complete list of transactions and paste in excel.

- Get a list of the required roles as added to the ZC_TEST composite role.
- Have the transactions as rows and the roles as columns.

- Get role details:
- SE16N
- Table: AGR_1251

- Role: Z*
- Object: S_TCODE

- Copy data into another worksheet (role data)

In a new column concatenate the role name and transaction using the ‘&’ operator. e.g: A1&B1

Also add a new column next to the above with just ‘X’ – This will be the value placed in the matrix.

- Use the following formula to populate the matrix:

=IF(COUNTIF(Role_Data!$C$1:$D$3548,$C$1&$A3),VLOOKUP($C$1&$A3,Role_Data!$C$1:$D$3548,2,FALSE)," ")

__Note:__ Formulas take a long time to calculate and when lots of formulas are used as in this case the spreadsheet becomes unusable. It is advised to copy the content into another spreadsheet.

You now have a complete up to date role matrix.