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.

  1. Call transaction DBACOCKPIT
  2. Open the folder Diagnostics on the left-hand side navigation tree
  3. Doubleclick on SQL Editor

SAP DBA Cockpit 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 )

SAP DBA Cockpit SQL Query

After hitting Execute (or pressing F8) you get the result directly on your screen:

SAP DBA Cockpit SQL Query Result

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 transactions DBACOCKPIT, SM49, SM69
  • Authorization object S_ADMI_FCD for STOR and SMSS
  • Authorization objects S_TABU_DIS and S_TABU_NAM to control table access