‎2008 Sep 02 6:21 PM
Hi Experts,
i want to test some SQL-Statements. For example: Select count(*), <field> from <table>
Is there any transaction in SAP to do this?
Thanks in advance.
Regards
Achim
‎2008 Sep 02 6:31 PM
As far i know there is no standard transaction , but you can create one for you.
Its not that tough !!!!
Edited by: karthik arunachalam on Sep 2, 2008 11:03 PM
‎2008 Sep 02 6:29 PM
This was also my first question when I started with ABAP development. I don't think such a transaction exists, and I have asked several experienced developers. So for now I have settled with using SQVI (Quick Viewer), but things like count(*) is of course not possible. I am watching this therad with great interest, hoping someone will provide a better alternative!
Another option I have considered is to use an external SQL tool for the database, but we use an Orcale DB and the default Windows SQL tool is not a very good solution (not to mention that you need to convince the DB admin to allow it).
‎2008 Sep 02 6:31 PM
As far i know there is no standard transaction , but you can create one for you.
Its not that tough !!!!
Edited by: karthik arunachalam on Sep 2, 2008 11:03 PM
‎2008 Sep 02 6:33 PM
What is the intended purpose?
If you want to test if it is pulling the correct data, it hardly takes any time to write a simple report with the select statement in DEV and see if it is pulling the right data.
If you are concerned of the performance of that particular select in Production, you can use the ST05 tool to analyse the SQL statement. This will not give you the data, but will give you the performance.
‎2008 Sep 02 9:52 PM
For general syntax errors and some information about performance, in ST05 the [Enter SQL Statement] could do the job.
for example:
select * from mara where mandt = :a1
[Explain] indicates, among other information:
- estimated cost
- estimated #rows
- best index to use in thr query
Regards.
‎2008 Sep 02 9:59 PM
>
> If you want to test if it is pulling the correct data, it hardly takes any time to write a simple report with the select statement in DEV and see if it is pulling the right data.
I would like to argue with that. If you are trying to create a complex nested SQL query, I think it is much quicker to be able to try out different variants of the SQL statement without having to build the code around it to present the results.
‎2009 Oct 29 3:48 PM
There is a way to look at the result set from ST05. Afer you see the result of the EXPLAIN screen, select SQL commands under the diagnostics folder on the left sidebar. Enter the query into the middle box on the right hand side and click on execute to view the results below the query.