Application Development 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: 

Authorization with Queries

Former Member
0 Kudos

Hi,

I have a Query created and I want that a user can execute it but only for a selected centers of the company. However, other users have to be able to execute the query without limitations.

How can I do that? (if it's possible)

Thanks,

Oscar

1 ACCEPTED SOLUTION

RichHeilman
Developer Advocate
Developer Advocate
0 Kudos

I don't think that this is possible using authorizations.

Regards,

Rich Heilman

7 REPLIES 7

RichHeilman
Developer Advocate
Developer Advocate
0 Kudos

I don't think that this is possible using authorizations.

Regards,

Rich Heilman

0 Kudos

Any idea to do that? A program?

vinod_gunaware2
Active Contributor
0 Kudos

<b>Authorizations</b>

The authorization object S_QUERY should be used to give proper authorizations to the user for a query. This authorization object has a field named ACTVT which can take values 02 for Change, 23 for Maintain and 67 for Translate.

This value determines whether the user can create and modify the query. The possible authorizations in the object are as follows:

S_QUERY_ALL Change, maintain and translate query

S_QUERY_UPD Change and Translate

Though the general concept of an ABAP query is moderately difficult, the results and the long term use of the ABAP query is worth the effort.

Just double click on the Object ZOBJECT..

AND ALSO CHECK THESE TRANSACTIONS..

SU21 - for authorizations objects..

SU53-- checking the authorizations values..

u have enter the respective fields while creating the authorization for the fields in su21..

Using SU21 u can create Authorisation Object.

regards

vinod

0 Kudos

This is a very good utility, but I need some users could execute queries with some values only. Otherwise, authorization object S_QUERY is very useful to avoid modifications of users.

Former Member
0 Kudos

I dont know whether is going to work or note, but its worth trying.

1. Select the field in SQ02 for that query.

2. Select CODE button at the application toolbar.

3. Use the coding section 'AT SELECTION SCREEN OUTPUT'.

4. Enter the code for authority check

AUTHORITY-CHECK <OBJECTNAME> VALUES <F1> = <P1>.

if no authorization then delete those corresponding records from that table.

Hope that helps.

0 Kudos

Dear Sharath kumar R,

I'll try it. It seems to be a good idea.

Oscar

0 Kudos

>

> I dont know whether is going to work or note, but its worth trying.

>

> 1. Select the field in SQ02 for that query.

> 2. Select CODE button at the application toolbar.

> 3. Use the coding section 'AT SELECTION SCREEN OUTPUT'.

> 4. Enter the code for authority check

> AUTHORITY-CHECK <OBJECTNAME> VALUES <F1> = <P1>.

> if no authorization then delete those corresponding records from that table.

>

> Hope that helps.

dear sharat kumar r,

i'm stuck at point 4.) of your list. i'm not an abaper but stuck with trying to get a query 'secure'. could you please advice how to phrase point 4? this is what i did:


AUTHORITY-CHECK OBJECT 'L_LGNUM'
         ID 'LGNUM' FIELD LTAP-LGNUM
         ID 'LGTYP' FIELD DUMMY.

  IF sy-subrc <> 0.
    MESSAGE 'No authorization' TYPE 'E'.
  ENDIF.

obviously the LTAP-LGNUM bit is totally wrong. first: it's a range, not a single value ... second: i don't know how to 'formulate' the <P1> bit of your instruction. everything else i did according to your description except this little part.

can you please help?