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

Multiple activities in authority-check

Former Member
0 Likes
7,752

Hello All,

is there an alternative for something like that?

AUTHORITY-CHECK OBJECT 'M_BEST_WRK'
           ID 'ACTVT' FIELD '01'
           ID 'ACTVT' FIELD '02'
           ID 'ACTVT' FIELD '03'
           ID 'WERKS' FIELD h_werks.

Can I put more than one activity in one field: ...'ACTVT' FIELD '01,02,03' or ... 'ACTVT' FIELD '01 02 03'?

Hello All,

is there an alternative for something like that?

AUTHORITY-CHECK OBJECT 'M_BEST_WRK'
           ID 'ACTVT' FIELD '01'
           ID 'ACTVT' FIELD '02'
           ID 'ACTVT' FIELD '03'
           ID 'WERKS' FIELD h_werks.

Can I put more than one activity in one field: ...'ACTVT' FIELD '01,02,03' or ... 'ACTVT' FIELD '01 02 03'?

2 REPLIES 2
Read only

Former Member
0 Likes
3,179

you should use it one by one based on the requirement ,

IF condition 1

AUTHORITY-CHECK OBJECT 'M_BEST_WRK'

ID 'WERKS' FIELD h_werks

ID 'ACTVT' FIELD '02'.

else if condition 2 .

AUTHORITY-CHECK OBJECT 'M_BEST_WRK'

ID 'WERKS' FIELD h_werks

ID 'ACTVT' FIELD '03'.

Endif.

.

Read only

Former Member
0 Likes
3,179

If security is set as usual, expect that:

1 will also have 2 and 3; 2 will also have 3. 3-only will have neither 1 nor 2, and some users may have nothing.

So do the authority check as many times as needed to figure out what your user's capabilities are:

If 1 fails (sy-subrc ne 0), try 2. If 2 fails, try 3. If fails 3, user cannot even view the data.