Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Automate Authorization Checks and minimize coding effort.

0 Likes
573

Hello SAPients!

This is the scenario: the company I work for has around of 200 programs (mostly reports) that are going to be used in different geographic areas around the globe (new acquisition of companies). The executive areas (the bosses) want that the new companies have access to only their information (the reports should display information only for the corresponding Company Code, Sales Organization, Purchasing Organization, Plant, etc.) But, that wasn't considered in those programs and none of them use AUTHORITY-CHECK statement.

We came out with one idea to minimize the coding effort: Create one Function Module per field (BUKRS, VKORG, EKORG, WERKS) and put the AUTHORITY-CHECK statements in these FMs. As input, these FMs will receive the selection screen fields (so_bukrs, pa_vkorg, ...) and as output the FMs will return the same fields with only the values that the user has access to, for example, if the system has company code 100, 200, 300 and 400 but the user has access only to 200, the FM should return only that value.

What do you think about this approach? Is it feasible? Do you have a better idea?

I hope I'm being clear in my explanation. Let me know if you need further information.

Thanks!

Hello SAPients!

This is the scenario: the company I work for has around of 200 programs (mostly reports) that are going to be used in different geographic areas around the globe (new acquisition of companies). The executive areas (the bosses) want that the new companies have access to only their information (the reports should display information only for the corresponding Company Code, Sales Organization, Purchasing Organization, Plant, etc.) But, that wasn't considered in those programs and none of them use AUTHORITY-CHECK statement.

We came out with one idea to minimize the coding effort: Create one Function Module per field (BUKRS, VKORG, EKORG, WERKS) and put the AUTHORITY-CHECK statements in these FMs. As input, these FMs will receive the selection screen fields (so_bukrs, pa_vkorg, ...) and as output the FMs will return the same fields with only the values that the user has access to, for example, if the system has company code 100, 200, 300 and 400 but the user has access only to 200, the FM should return only that value.

What do you think about this approach? Is it feasible? Do you have a better idea?

I hope I'm being clear in my explanation. Let me know if you need further information.

Thanks!

4 REPLIES 4
Read only

Former Member
0 Likes
535

Hi Ricardo,

What benefits you will achieve using FM?

You need to call this FM in your program anyway.

Better modify programs using Authority check.

Regards,

Atish

Read only

0 Likes
535

Atish,

The idea is to show the list of messages in the FM ("You don't have access to company codes XXX, YYY, ZZZ") and return the selection field with the corresponding values.

Thanks!

Read only

0 Likes
535

Any other idea will be greatly appreciated.

Thanks!

Read only

0 Likes
535

Solved! Yes, we used the mentioned approach and everything worked just fine.