Authorization in ABAP Query
Dear Guys
Is it true that ABAP Query bypass Authorizations Profiles while ABAP reports dont,
Hi,
Generally QUERY's are User Specific (Pertaining to USER GROUP).
Where as Reports are Global to all, Unless you restrict them with some Explicit Authorizations.
Regards,
Anji
Similar Messages
-
Hello all,
Can I benefit a little from your experience with SAP Query(ABAP) and Adhoc Query(ABAP)?
My customer want to use both SAP Query and Adhoc Query.
And they want to separate for SAP Query as preset report program and Adhoc Query as general-purpose reporting tool.
And I want to know how to separate authorizations of SAP Query and Adhoc Query as below.
As for SAP Query, users can only execute and cannnot change or delete it.
As for Adhoc Query, users can save Queries they created or changed in Adhoc Query.
I know there is only one authorization object for SAP Query:S_QUERY
Is there any solution for that kind of request?
Thanks and Regards,
HanaeHello,
We have check in the abap program ask you functional to give the authorization object i.e. y_k_autchk
and ask him for which filed we have to give authorizaion.
AUTHORITY-CHECK OBJECT y_k_autchk
ID 'WERKS' FIELD y_wa_tvarv-low. -
Regarding ABAP Query authorization group
Hi Team,
This is regarding ABAP Query!
I have created one authorization group, for testing i have assigned my id in authorization group.
After creation of ABAP query,standard program got generated. Now i have created one transaction code at the last for the ABAP Query.
Now the isse is even though i have deleted my id from the authorization group. I am able to execute the query from SQ01 and with the Transaction code .
It should not happen...i want who soever id is mapped to the transaction code ...that member should only be able to run that query, otherwise there is no use of authorization group.
Please help me out in this case.
Thanks & Regards,
Anil Kumar SahniAre you sure that you don't have access to that authorisation group? Execute report RSUSR002. In the 'Authorization Object 1' block inform S_TABU_DIS in 'Auth.Object' and accept. Then inform Activity=03 and Auth.Gruop= your group.
You will get a list of all the users which, theoretically, will be able to execute the query. If you press 'Roles' or 'Profiles' in the toolbar of the listing you will get to know why you have authorisation. May be you have the SAP_ALL profile.
Also, one more thing to take into account: how have you created your transaction? Is it referring directly to the generated report? Then it is an error, you should execute program SAP_QUERY_CALL. Read this post: [Relate transaction to query; -
I have created the varient name CUS& for attaching the abap query varient in tranport request. I have done this. but I am geting following error. please help me on this. thanks.
The varient is created as Protected by default. I can't able to create the varient unprotected. Can you tell me how to create unprotected varient for SAP Query? becuase other user can't able to change the varient it is giving the error message with my user name as " No authorization to change the varient <varient name> Protected by <my user name>".
Please could you help me how to fix it. this issue?Hi
Thanks for your inputs.I am using ABAP query for first time. Can you advice where to check for same.
Regards
Dinesh -
Hi,
I have one ABAP query which is already created by someone. I want to ADD one field in where condition.. How do I do itu2026Need to add it in where condition in select query.
I want to know the steps to be followed..
Thanks
RBHI Ramesh,
Here are some information before you modify ABAP query relating to other developer.
To use an ABAP query, the user must have appropriate authorizations. Two ways of providing authorizations to the users are as follows:
- User groups
The user should be a part of at least one user group to run the corresponding ABAP query. This automatically restricts the access of the user to specific functional areas, and thus the corresponding underlying logical databases.
- Authorizations
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
Hope this information can help you.
Best Regards,
Krishna -
Hi Friends,
can i send me Creation of ABAP QUERY...
REGARDS,What Is SAP Queries
Many times a need arises for SAP Users and Functional Consultants to generate quick reports without getting any ABAP coding done time taken to complete the coding in development, transport and test it in QA system and then transport to production is sometimes too long. In such cases, ABAP/4 query is a tool provided by SAP for generating these kind of reports.
Type of Report Desired:
Before starting to write an ABAP query, its advisable to decide the type of report that the user wants. ABAP query provides the following type of reports:
Basic List Simple report
Statistics Report containing statistical functions like Average &Percentage
Ranked List Report written for analytical purpose
The output is always seen in the order of Basic List, then Statistics and then Ranked List if any. One ABAP query can have one basic list, maximum of 9 statistics and maximum of 9 ranked lists.
In a nutshell, an ABAP/4 query can be designed in four steps
- Creation of a user group
- Creation of functional area
- Assignment of user group to functional area
- Creation of the query based on functional area
The various objects that form an ABAP query can be created in the following 2 ways:
- Tools => ABAP/4 Workbench => Utilities => ABAP/4 Query
OR
- By executing the transaction codes mentioned below:
SQ01 ABAP/4 Query
SQ02 Functional Area
SQ03 User group
Step I - Create Functional Area
In the functional area section, the user indicates from which part of the SAP database the data is going to be retrieved and how the data is to be retrieved by the query. One functional area can be assigned to many user groups. A functional area can be created with or without a logical database. To create a functional area with a logical database, one has to mention the name of the database and then select the fields from the tables that form the logical database.
ABAP Query Authorizations: To use an ABAP query, the user must have appropriate authorizations. Two ways of providing authorizations to the users are as follows:
- User groups
The user should be a part of at least one user group to run the corresponding ABAP query. This automatically restricts the access of the user to specific functional areas, and thus the corresponding underlying logical databases.
- Authorizations
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.
Creating the ABAP Query
To create the query use the menu path Environment => Queries
· Give a name to the query and click on the Create button
· Give the description of the query in the next screen. Specify the output length and select the processing option from the Further Processing Options box. The data can be displayed in various formats such as table, download to a file, and display in Word etc.
· Click on the Next screen icon. Select the functional group screen. All the functional groups created in the functional area are displayed. Select the groups that you desire fields from only these groups will be displayed in the output. Click on the respective check boxes and click on the Next Screen icon.
· The Select Field screen gets displayed. Select all the fields from the user group that you need to display on the output of the query. If required, specify the short names for the fields using the menu path Edit => Short Names => Switch On/Off or you can also change the selection text contains in the order you want to appear on the selection screen. You can also maintain column headers for the fields by using the menu path Edit => Column Header => Maintain.
· Click on the Next Screen icon to get the Selections Screen. Here you can check against the fields that you require to be shown on the selection screen.
· Now we need to specify the output type for the query as Basic List, Statistics or Ranked List. Choose the option Basic List.
· On the Basic List line structure screen the following things can be done
o Specify the report layout in detail lines on which the fields will appear.
o Order in which the fields will appear in the output
o Sort order for the fields this is optional.
o For the numeric fields you can check against the fields for which you require totals in the output.
o Beautify the output according to the options provided.
· Click on the next screen icon, to specify the control levels as mentioned below
o Specify the sort order. The default sort order is ascending and can be changed to descending if required.
o Totals for each field selected for sorting can be displayed
o To display the output of a field in a box click on the check box against box. To display a line after the output of a field, click on the check box against BlnkLn
o To display the output of a field on a new page click on the check box against New Page
· Click on the next screen icon to get the List Line options Screen. Here you can specify the background color for displaying the output.
· Click on the next screen icon to get the Field Output Option screen. In this you can specify the following:
o Change the output length or the display positions of the fields
o Specify the display position of the unit for quantity or currency fields. Click left radio button to display it before the figure, middle radio button to display it after the figure while last radio button to hide the unit altogether.
o Specify color for the column of every field under the Format option.
o Specify the label against the output of sort fields.
· Click on the Next screen option to go to the Basic List Header screen. Here you can specify
o Give page header and page footer for the output
o Include user name and date by specifying &N and &D respectively.
After providing all the above options you can save the query and execute it by clicking the Execute button twice
Regards,
Maha -
Assign SQ03 Abap Query User Group to role
Please advise how to assign SQ03 Abap Query User Group to a role. Thanks.
Moderator message: please do more research before asking.
[Rules of engagement|http://wiki.sdn.sap.com/wiki/display/HOME/RulesofEngagement]
[Asking Good Questions in the Forums to get Good Answers|/people/rob.burbank/blog/2010/05/12/asking-good-questions-in-the-forums-to-get-good-answers]
Edited by: Thomas Zloch on May 12, 2011 5:40 PMHello Sunil,
The problem is that I have hundreds of users to maintain user groups.
found out that it is possible to assign user group to role and role to user groups. implementing hr authorization with in-direct assignment of auth. So if I could use sq10, user groups could also be link to position in the org chart.
sq10 does allow you to assign a user group to a role but when you assign the role to a user and the user runs a query, it reports that no user group has been assigned.
Suspect that there must be a parameter or switch that is not turned on
Regards -
Can we join two totals tables in ABAP Query
Hey Gurus!
Can we join two totals tables in ABAP query.
I am tyring to join FAGFLEXT with internal orders totals table.
Thanks
SHi,
Report painter majorily operates around characteristics and key figures.
ABAP query comes even more handy. The advantage is -
1. You can link many tables
2. Create selection screen as you like to have
3. User friendly report creation
4. Logic can also be coded.
5. Authorization can be set
I have written a article in SDN, which gives you an idea as to how to go about using ABAP query. Have a look on this - [Article - Practical Usage of ABAP Query|https://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/20f6b256-23be-2b10-8b93-cad83a617634]
Regards,
Sridevi -
Authorisation check in ABAP Query..
Hi Gurus
Can we put Authorization check in ABAP Query ?
Your help is appreciated.
Regards,
GajananHi,
Please check this online document on how to setup authorization for SAP query.
http://help.sap.com/printdocu/core/Print46c/en/data/pdf/BCSRVQUE/BCSRVQUE.pdf
Regards,
Ferry Lianto -
How to create an ABAP Query with OR logical expression in the select-where
Hi,
In trying to create an ABAP query with parameters. So it will select data where fields are equal to the parameters entered. The default logical expression is SELECT.. WHERE... AND.. However I want to have an OR logical expression instead of AND.. how can I attain this??
Please help me on this.. Points will be rewarded.
Thanks a lot.
Regards,
Question ManHi Bhupal, Shanthi, and Saipriya,
Thanks for your replies. But that didn't answer my question.
Bhupal,
You cannot just replace AND with OR in an ABAP QUERY. ABAP QUERY is a self generated SAP code. You'll just declare the tables, input parameters and output fields to be displayed and it will create a SAP standard code. If you'll try to change the code and replace the AND with OR in the SAP standard code, the system will require you to enter access key/object key for that particular query.
Shanthi,
Yes, that is exactly what need to have. I need to retireve DATA whenever one of the conditions was satisfied.
Saipriya,
Like what I have said, this is a standard SAP code so we can't do your suggestion.
I have already tried to insert a code in the ABAP query (there's a part there wherein you can have extra code) but that didn't work. Can anybody help me on this.
Thanks a lot.
Points will be rewarded.
Regards,
Question Man -
Logical database of ABAP query
Hi,
Can anybody please let me know what is the Logical database for ETXDCI, ETXDCH & ETXDCJ (Tax tables) with any sales document tables? I need to develop one ABAP query for the users.
I am a Functional person so I would like to know Can anybody please let me know how I can find out the Logical database?
Your time and help will be really appreciate.
Thanks & Regards,
Niki Shah.Try the BRF logical database.
I found it by searching in which programs the tables were used.
It show program SAPDBBRF which is the program for logical database BRF.
Kind regards,
Arthur Parisius -
hi.
i need to create an ABAP/sap query. when i created the InfoSet i used logical db-pnp.
if i want to get only the employees which entered my organization during the last month where should i add the ABAP code, under which section => extras -> code. i have there several options - data, initialization, at selection-screen output etc, what to choose??????????
thanks,
AmiHi
Welcome to SDN forum
query has got some limitatins compared to Reports which we write using SE38
these queries are user specific and client specific and can't be transportable and you can't write your own code as you wish like reports
see the doc
http://help.sap.com/saphelp_46c/helpdata/en/35/26b413afab52b9e10000009b38f974/content.htm
http://www.thespot4sap.com/Articles/SAP_ABAP_Queries_Introduction.asp
Step-by-step guide for creating ABAP query
http://www.sappoint.com/abap/ab4query.pdf
ABAP query is mostly used by functional consultants.
SAP Query
Purpose
The SAP Query application is used to create lists not already contained in the SAP standard system. It has been designed for users with little or no knowledge of the SAP programming language ABAP. SAP Query offers users a broad range of ways to define reporting programs and create different types of reports such as basic lists, statistics, and ranked lists.
Features
SAP Query's range of functions corresponds to the classical reporting functions available in the system. Requirements in this area such as list, statistic, or ranked list creation can be met using queries.
All the data required by users for their lists can be selected from any SAP table created by the customer.
To define a report, you first have to enter individual texts, such as titles, and select the fields and options which determine the report layout. Then you can edit list display in WYSIWYG mode whenever you want using drag and drop and the other toolbox functions available.
ABAP Query, as far as I Believe, is the use of select statements in the ABAP Programming. This needs a knowledge of Open SQL commands like Select,UPdtae, Modify etc. This has to be done only by someone who has a little bit of ABAP experience.
To sum up, SAP queries are readymade programs given by SAP, which the user can use making slight modification like the slection texts, the tables from which the data is to be retrieved and the format in which the data is to be displayed.ABAP queries become imperative when there is no such SAP query existing and also when there is a lot of customizing involved to use a SAP Query directly
use either SQ02 ans SQ01
or SQVI tr code
for more information please go thru this url:
http://www.thespot4sap.com/Articles/SAP_ABAP_Queries_Create_The_Query.asp
http://goldenink.com/abap/sap_query.html
Please check this PDF document (starting page 352) perhaps it will help u.
http://help.sap.com/printdocu/core/Print46c/en/data/pdf/BCSRVQUE/BCSRVQUE.pdf
check the below link will be helpful for u
Tutorial on SQVI
once you create query system generates a report starting with AQZZ/SAPQUERY/ABAGENCY2======= assing this report to tr code for the same
Regards
Anji -
Wrong sequence in selection screen generated by ABAP Query
Hi,
I am developing a query to display the data in the view.
My query has 8 selection fields totally.
As part of my requirement I have added selection parameter in the
selections tab of the infoset and maintained the sequence as 9.
Inspite of maintaining the sequence number as 9 in the infoset, It is
appearing first in the selection screen of the query.
I tried putting different numbers in the sequence number, but even it
is appearing first in the selection screen.
Can you please let me know how to display the selections declared in
the infoset as per the sequence required.
Thanks,
Madhuri.Actually what happen when you declare your own fields in ABAP query . you have to care about the sequence . As an example if youre selecting lets say state name , you have two variables
<b>1-state
2- land</b>
for state you have to select land first , if your state is first and land is 2nd it gave you the error of sequence .
Because you have to get data in land first in order to get state specific to the land .
it should be
1-Land
2-State
Just see the your fields , Im sure youre missing that .
<b>You can also see the NO ( field ) in Query ( Sq03 ) . where you can define the seqence on selection.</b>
hope thisll help you .
Pl...Award the points .
Thanks
Saquib<b></b>
Message was edited by: Saquib Khan -
Performance tuning for ABAP Query (created from t-cd SQ01)
Hello all,
We created ABAP Query report from transaction SQ01.
But the generated report has an appropriate SQL statement which causes performance problem.
To solve this issue, I guess the easiest way is;
0. Give up to use it.
1. Copy it to another object in the customer namespace.
2. Ajust SQL statement.
But I'm wondering if there're appropriate ways to adjust SQL statement of Query.
Could anybody give me any better idea?
Thank you
YukoYou can try this: Create 2 ranges, for objnr and cdtcode and fill like:
ra_objnr-sign = 'I'.
ra_objnr-option = 'CP'.
ra_objnr-low = 'OR*'.
append ra_objnr.
ra_code-sign = 'I'.
ra_code-option = 'CP'.
ra_code-low = 'CO*'.
append ra_code.
SELECT objnr udate utime
FROM jcds
INTO TABLE it_jcds
WHERE objnr IN ra_objnr
AND stat = l_tj02t
AND cdtcode IN ra_code
AND inact = space
Regards,
John. -
How to hide some fields in ABAP Query
Hi,
My ABAP Query has a long list of extracted fields. I wanted to set some of these output to "HIDE".
This allow User the flexibility to decide what fields to show.
How can I set the field to "HIDE" in my query?
Thanks
byeHi Tim,
You can do this by setting the Report layout variant in following steps:
1. First define the parameter on selection screent for report variant.
2. Data decelaration for variant.
3. Value request to get already present variants on report:
4. If doesn't choose the layout take out the default report layout.
5. Initialize the report variant.
6. Apply the variant to the REUSE_ALV_GRID_DISPLAY funtion module.
Here to generate report variant first to open report output and then as per according to user set the layout of report using the layout icon of ALV with summation on value fields (as required) and create layout name.
*Data Deceleration as below:
Data :g_save(1) TYPE c,
** g_default(1) TYPE c,
g_exit(1) TYPE c,
gx_variant TYPE disvariant,
g_variant TYPE disvariant.
*First Define the parameter to give layout of Report variant.
SELECTION-SCREEN BEGIN OF BLOCK 3 WITH FRAME TITLE text-003.
PARAMETERS: p_vari TYPE disvariant-variant.
SELECTION-SCREEN END OF BLOCK 3.
* Process on value request
AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_vari.
PERFORM f4_for_variant.
* Selection-Screen Checking
AT SELECTION-SCREEN.
PERFORM pai_of_selection_screen.
INITIALIZATION.
w_repid = sy-repid.
PERFORM variant_init.
* Get default variant
gx_variant = g_variant.
CALL FUNCTION 'REUSE_ALV_VARIANT_DEFAULT_GET'
EXPORTING
i_save = g_save
CHANGING
cs_variant = gx_variant
EXCEPTIONS
not_found = 2.
IF sy-subrc = 0.
p_vari = gx_variant-variant.
ENDIF.
FORM f4_for_variant .
CALL FUNCTION 'REUSE_ALV_VARIANT_F4'
EXPORTING
is_variant = g_variant
i_save = g_save
IMPORTING
e_exit = g_exit
es_variant = gx_variant
EXCEPTIONS
not_found = 2.
IF sy-subrc = 2.
MESSAGE ID sy-msgid TYPE 'S' NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
** ELSE.
** IF g_exit = space.
** ENDIF.
ENDIF.
ENDFORM. " f4_for_variant
FORM pai_of_selection_screen .
IF NOT p_vari IS INITIAL.
MOVE g_variant TO gx_variant.
MOVE p_vari TO gx_variant-variant.
CALL FUNCTION 'REUSE_ALV_VARIANT_EXISTENCE'
EXPORTING
i_save = g_save
CHANGING
cs_variant = gx_variant.
g_variant = gx_variant.
ELSE.
PERFORM variant_init.
ENDIF.
ENDFORM. " pai_of_selection_screen
FORM variant_init .
CLEAR g_variant.
g_variant-report = w_repid.
ENDFORM. " variant_init
**While Showing report pass the variant :::
g_save = 'A'.
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
i_callback_program = w_repid
i_structure_name = 'IT_MAIN'
is_layout = i_layout
is_print = i_print
it_fieldcat = i_fieldcat[]
it_events = i_events[]
i_save = g_save
is_variant = g_variant
TABLES
t_outtab = it_main
EXCEPTIONS
program_error = 1
OTHERS = 2.
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
Many Thanks / Himanshu Gupta
Maybe you are looking for
-
Plant and Cost Center are not displaying in FI doc. for asset scrap ABAVN.
Hi All, When we do asset retirement by Scraping using Transaction Code ABAVN, Plant and Cost center are not appearing in the FI document. But, in the master data the Plant and Cost center are assigned for the particular Asset. When I see the FI docu
-
Anyone else have ing trouble getting new thumbnails to show on the provider page in the new PSM? I'll load a new thumbnail image for a collection and the new thumbnail will sometimes show up on the provider page in a day or so, sometimes it never upd
-
Is it possible if Back ground job cancelled and spool list is generation?
Hi Experts, Need help regarding the background job ( custom z-program ) . In production server the scheduled job has got cancelled after certain time limit. we are using the standard bapi BAPI_MATERIAL_SAVEDATA in the z-programto comit the data into
-
ADF Faces.NEXT - When is it going to be available?
Does anyone know when the ADF Faces.NEXT is scheduled to be released? I've looked at the on-line seminars (by Jonas Jacobi) showing the features of Faces.NEXT. However there is no information on when Oracle plans to release these components.
-
Access denied against DP for untrusted clients
Hi, I have an SCCM 2012 R2 environment. There are a few clients in an untrusted domain behind a firewall. DP's and MP's are not configured for SSL. The following ports have been opened to the MP and DP's. TCP 80 TCP 10123 TCP 2710 DNS or AD for the u