Abap Query Execution
Hi,
I want to execute Abap Query using a Transaction Code. Please help me out to run a query using Transation code.
Thanks in Advance
John Vikram
GOTO the transaction 93.
Create a transaction code that is required to run a query from your report.
give short text, choode program and selection-screen.
SAVE.
This is the way to run a query from a report using tcode.
Reward points if useful.
Or if you need more help, pls reply back.
Similar Messages
-
ABAP Query Execution via Custom Transaction Code - Not working
We have created an ABAP Query in our DEV client and we then created a transaction code to run that query. We have done this because the customer does not want anyone to have access to SQ01, SQ02 in production. This works great in DEV but we can not get it to work in production.
The ABAP Query was exported to our Prod client successfully. I say exported because you do not do direct transports with queries.
We then transported the new transaction code to run the query to production and it was successful.
However, when we run the transaction is production we get a sys dump stating it can not find the query.
We believe the problem is the TRDIR table is missing an entry for the program in production (it has an entry in DEV).
I would have thought that the export on the query would have brought in this entry -but obviously not.
Any suggestions on how we can get this entry into the production client? Did we miss a step on the export that would do this? We want to only bring over this entry - not the entire TRDIR table for obvious reasons (size (1.5 million entries, programs not ready for production, etc.).
Please help!
Thanks.
ScottHi,
The above solution will work if you assign the transaction in one server, If you want this will not work in quality/production boxes when transported the query..the program name will not be the same in all the servers...
For this. Do the below:
In SE93, Create a Paramter Transaction
-> Transaction = Start_report
-> In default values, give the below details:
D_SREPOVARI-REPORTTYPE = AQ
D_SREPOVARI-EXTDREPORT = Name of the Query
D_SREPOVARI-REPORT = User Group
Save the transaction..Now if the program is generated with different names in the quality/proudction, this will still work..
Regards
Vijay Hebbal -
ABAP query processing in bgrnd and saving file to prsntn/application server
Hello Gurus
I have question regarding to ABAP query execution. Currently I try to find out if ABAP query can be executed in background and store the result into UNIX directory or in the presentation server(desktop). What I found is that the report need to be executed using option Private File and the data by default will be stored at directory /sap/outbound/.
However what I found next is that the maximum fields should be 64 fields. If the query result has more than 64 fields, the error will occurs WRITE_TO_OFFSET_TOOLARGE.
My question is:
1. Can we set the directory in unix folder to someplace else than /sap/outbound/ ?
2. Can we set in order to have the report stored without limitation 64 fields?
Thanks in advanceHI
Yes you can set the directory in unix folder to someplace as you need to get confirmation for the path from your Functional Analyst.
Thanks -
Hi experts,
Is ABAP query execution logged in the system? i have a requirement where i have to find out all the ABAP queris which are executed in given span of period. Is there any way to find this?
Many thnx in advance,..
Regards,
Karthick Chi
just try out SLG1 transaction
hope it helps
regards
Aakash Banga -
Asset query execution performance after upgrade from 4.6C to ECC 6.0+EHP4
Hi,guys
I am encounted a weird problems about asset query execution performance after upgrade to ECC 6.0.
Our client had migrated sap system from 4.6c to ECC 6.0. We test all transaction code and related stand report and query.
Everything is working normally except this asset depreciation query report. It is created based on ANLP, ANLZ, ANLA, ANLB, ANLC table; there is also some ABAP code for additional field.
This report execution costed about 6 minutes in 4.6C system; however it will take 25 minutes in ECC 6.0 with same selection parameter.
At first, I am trying to find some difference in table index ,structure between 4.6c and ECC 6.0,but there is no difference about it.
i am wondering why the other query reports is running normally but only this report running with too long time execution dump messages even though we do not make any changes for it.
your reply is very appreciated
Regards
BrianThanks for your replies.
I check these notes, unfortunately it is different our situation.
Our situation is all standard asset report and query (sq01) is running normally except this query report.
I executed se30 for this query (SQ01) at both 4.6C and ECC 6.0.
I find there is some difference in select sequence logic even though same query without any changes.
I list there for your reference.
4.6C
AQA0FI==========S2============
Open Cursor ANLP 38,702 39,329,356 = 39,329,356 34.6 AQA0FI==========S2============ DB Opens
Fetch ANLP 292,177 30,378,351 = 30,378,351 26.7 26.7 AQA0FI==========S2============ DB OpenS
Select Single ANLC 15,012 19,965,172 = 19,965,172 17.5 17.5 AQA0FI==========S2============ DB OpenS
Select Single ANLA 13,721 11,754,305 = 11,754,305 10.3 10.3 AQA0FI==========S2============ DB OpenS
Select Single ANLZ 3,753 3,259,308 = 3,259,308 2.9 2.9 AQA0FI==========S2============ DB OpenS
Select Single ANLB 3,753 3,069,119 = 3,069,119 2.7 2.7 AQA0FI==========S2============ DB OpenS
ECC 6.0
Perform FUNKTION_AUSFUEHREN 2 358,620,931 355
Perform COMMAND_QSUB 1 358,620,062 68
Call Func. RSAQ_SUBMIT_QUERY_REPORT 1 358,569,656 88
Program AQIWFI==========S2============ 2 358,558,488 1,350
Select Single ANLA 160,306 75,576,052 = 75,576,052
Open Cursor ANLP 71,136 42,096,314 = 42,096,314
Select Single ANLC 71,134 38,799,393 = 38,799,393
Select Single ANLB 61,888 26,007,721 = 26,007,721
Select Single ANLZ 61,888 24,072,111 = 24,072,111
Fetch ANLP 234,524 13,510,646 = 13,510,646
Close Cursor ANLP 71,136 2,017,654 = 2,017,654
We can see first open cursor ANLP ,fetch ANLP then select ANLC,ANLA,ANLZ,ANLB at 4.C.
But it changed to first select ANLA,and open cursor ANLP,then select ANLC,ANLB,ANLZ,at last fetch ANLP.
Probably,it is the real reason why it is running long time in ECC 6.0.
Is there any changes for query selcection logic(table join function) in ECC 6.0. -
Hide/Delete lines from ABAP Query output when Quantity is 0
Hi all,
I'm changing an existing abap query. My requirement is to delete the rows from the report output where qantity = 0.
I tried the following ways.
1. In SQ01, select the quantity field and check the checkbox for "Display only field <> 0", but this didnt worked as it will
supress the zero from display.
2. I tried to write code in the Infoset SQ02->Edit->Code. I wrote the following code "CHECK vbep-wmeng IS NOT INITIAL".
Here the problem is, the code is not executing in the test client. When I open the Infoset in test(i mean development test)
client the code is there, but when i execute the program its not working. I tried using "BREAK-POINT", program executions
does not stop at the break point. There is existing code in the event "START-OF-SELECTION", this code I'm able to see in the
query program opened through SE38. I edited the existing code and kept a break point in between, and now checked in the
program in SE38, but the changes are not reflected. I'm able to see old code only(even after save n generate).
3. Gave search in SCN, google etc.
Please note.
1. I'm not using any Logical Database in the Infoset. Its a simple join of 4 tables.
2. Query is created in the Global Area (cross client) not client specific.
Can anybody tell me what could be the problem and how can Over the above issues and achive the requirement.
Thanks in advance.
Edited by: Mr A on Feb 25, 2010 1:39 AMDear Mr A,
Can i know how did u solve the issue even i'm facing the same problem.
Regards,
Karan Bhasin -
How to get count(*) in ABAP Query...
Hi All,
Can someone of you tell me, how to do the following in the ABAP Query. I want to get the count of records retreived during the query execution and display it in the output.
example::: Select count(*) from VBRK.
Thanks a lot.
Thanks!
Puneet.From help doc:
Note
The SELECT COUNT( * ) FROM ... statement returns a result table containing a single line with the result 0 if there are no records in the database table that meet the selection criteria. In an exception to the above rule, SY-SUBRC is set to 4 in this case, and SY-DBCNT to zero.
You can just run SELECT COUNT (*) FROM TABLE
Number of rows is returned in SY-DBCNT
Edited by: Kevin Lin on Jul 2, 2008 10:55 PM -
Dear all,
I have created ABAP query on purchasing. But in SQ1, when I executed " TEST", it throws message "List is wider than 255 characters (generation not possible) ". please let me know what changes I need for successful execution of query?
thanks and regards,
PrashanthHi Prashanth,
It seems that the output that you generate is wider than 255 char. try with lesser fields in the output and check.
Hope it helps.
Thanks,
Anju -
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 -
Issue while query execution on web analyser.
Hi,
I am getting an error message while query execution on web ie Record set too large , data retrieval restricted by configuration .I am able to run the same query in bex analyser without any issue .Any idea what could be the reason and solution for this issue .
Regards,
Neetika.Hi Neetika,
The Query is exceeding the set limits,i suggest you to Reduce the time LIne for the Query, as it may be having more number of Cells in terms of Rows and Columns.
Execute the Query for Less number of Days,if u r executing it for 1 Month then execute it for 10 Days.
Rgds
SVU123
Maybe you are looking for
-
How to add hotmail account to my mac mail?
I want to manage may hotmail account in my mail from my macbook pro. Apparently, I could add the account but it cant sincronize. Could somebody help me?
-
Adobe - Triggering workflow in ABAP
Hi, From the Adobe offline form - submission I want to trigger a workflow in R/3 system. I also want the same adobe form to be sent as an attachment. so that after checking the workflow the key user can edit the form and resubmit it again which will
-
PopUp window at public wifi hotspots?
If I connect to a public wifi hotspot I get a popup window where the landing page from the operator is shown (captive portal). How can this be managed? Because the window is closed after the login there is no chance to get the session window for logo
-
Appropriate project settings.HELP
ok,I've never worked with HD formats,yesterday i bought my HD camera and i need some help. What is the appropriate settings to start my HD project.I know,iknow...thats why exist the easy setup and audio/video settings.But I saw some discussions talki
-
Hi All, I am trying to use DTW to import updated shipping dates on Sales Orders (this is unique per line). I created the two files (Headers and Lines), the import seems to work fine. However, on checking the results I can see that in fact it does not