Friday, 24 January 2020

Automating authority-check in Z/Y transactions

After some years, I’ve faced with a new project that could be a little bit boring, that were called “check user authorizations in Z transactions” in the security information sector, but in the end of the day, it was funny.

The number of Z transactions were higher than I expected, something like 1000 transactions, so after some thinking, I’ve found a “automatic” way to deal with it.

Go to SE24 and create a Simples Class.

SAP ABAP Study Materials, SAP ABAP Learning, SAP ABAP Tutorial and Materials, SAP ABAP Certifications, SAP ABAP Online Exam

Then, create a STATIC method.

SAP ABAP Study Materials, SAP ABAP Learning, SAP ABAP Tutorial and Materials, SAP ABAP Certifications, SAP ABAP Online Exam

In parameters, I’ve used 10 id and 10 field check, that’s the maximum that the standard command authority-check object support.

SAP ABAP Study Materials, SAP ABAP Learning, SAP ABAP Tutorial and Materials, SAP ABAP Certifications, SAP ABAP Online Exam

SAP ABAP Study Materials, SAP ABAP Learning, SAP ABAP Tutorial and Materials, SAP ABAP Certifications, SAP ABAP Online Exam

In my logic I’ve not considered the “DUMMY” check, it makes no sense to use when we talk about the security information.

The method will check throught the maximum of id’s and fileds to the minimum, like this way:

SAP ABAP Study Materials, SAP ABAP Learning, SAP ABAP Tutorial and Materials, SAP ABAP Certifications, SAP ABAP Online Exam

SAP ABAP Study Materials, SAP ABAP Learning, SAP ABAP Tutorial and Materials, SAP ABAP Certifications, SAP ABAP Online Exam

A simple test to check if it is working as expected.

SAP ABAP Study Materials, SAP ABAP Learning, SAP ABAP Tutorial and Materials, SAP ABAP Certifications, SAP ABAP Online Exam

SAP ABAP Study Materials, SAP ABAP Learning, SAP ABAP Tutorial and Materials, SAP ABAP Certifications, SAP ABAP Online Exam

SAP ABAP Study Materials, SAP ABAP Learning, SAP ABAP Tutorial and Materials, SAP ABAP Certifications, SAP ABAP Online Exam

Using display Like ‘I” in message.

SAP ABAP Study Materials, SAP ABAP Learning, SAP ABAP Tutorial and Materials, SAP ABAP Certifications, SAP ABAP Online Exam

And the most important, the SU53 values to be used to map the authorizations needed by the user.

SAP ABAP Study Materials, SAP ABAP Learning, SAP ABAP Tutorial and Materials, SAP ABAP Certifications, SAP ABAP Online Exam

That’s it guys, the Abap version used on this customer is the 731, so not so much to do about “advanced” programing.

No comments:

Post a Comment