There are situations where it comes in handy to run a database statement directly, without the need for ABAP programming.
SQL Editor in DBA Cockpit
The DBA Cockpit comes with a SQL Editor with which you can easily execute your SQL queries on your SAP system.
- Call transaction
DBACOCKPIT
- Open the folder
Diagnostics
on the left-hand side navigation tree - Doubleclick on
SQL Editor
How to run a SQL query
Queries are entered in the Input Query
section. Change to row limitation to a suitable value for your case.
In this example, we want to get all Deliveries which are not assigned to a Shipment.
SELECT * FROM likp WHERE vbeln NOT IN ( SELECT vbeln FROM vttp )
After hitting Execute
(or pressing F8) you get the result directly on your screen:
Other features worth mentioning:
- Queries can be further analyzed by pressing
Explain
in the stats bar - Queries can be saved for future use
Required Authorizations
Following authorization objects need to be maintained for the DBA Cockpit
- Authorization object
S_TCODE
for transactionsDBACOCKPIT
,SM49
,SM69
- Authorization object
S_ADMI_FCD
forSTOR
andSMSS
- Authorization objects
S_TABU_DIS
andS_TABU_NAM
to control table access