SQL Console with Eclipse ADT

ABAP SQL Console with Eclipse

Index

 

Introduction:

SQL console with Eclipse ADT is one of the most powerful tools which is not present in classical GUI ABAP workbench. With SQL console, now a Developer can directly query on SAP Business Database schema and can check the result/output on the fly.

SQL Console is a new tool which every ABAPer must Know!

Earlier, to do similar job, a small ABAP program had to be written which was time consuming work. Some quick pointers:

  • SQL console is a very handy tool in Eclipse which facilitates user to query on DDIC including CDS views
  • This is different than SQL console present in HANA modeler where query should identify right schema
  • In addition, Developer can quickly query on table(s) & analyze result to utilize same in code

 

How to access ADT SQL Console:

Right Click on Project > SQL Console

Diagram 1 : Open SQL Console

 

Data Preview:

  • In SQL console, developers can freely query on DDIC and check result on the fly
  • Run from within console is possible along with Query checking
  • After that, Filter is a handy feature to filter out result
  • Define – Max rows for output and number of entries
  • Above all, Result export in following formats is possible:
    • Delimited text file
    • HTML file
    • XML file
Diagram 2 : Look and feel for SQL Console

Commenting in SQL console: A double quote( “ ) just as ABAP can be used for writing comment in SQL console.

More features in SQL Console:

Refer Diagram:

Diagram 3 : Various Features in SQL Console
  1. Check(Diagram 3): Press this button or not, automatic check of SQL in SQL console is available. After that, Pressing this button explicitly checks the syntax of SQL again on user’s demand. If any error is found in the syntax, this is notified upfront to the user as below:

2. Data Aging(Diagram 3): SAP with HANA distinguishes the data with respect to their “Temperatures”. They are:

  1. HOT data: More relevant data
  2. COLD data: Less relevant data or Data identified for archival

For instance, Turning this Flag ON or OFF, hints the database about the temperature of data to be retrieved on selection of data/execution of query.

3. Max Rows(Diagram 3): Max Rows suggests the number of records to be retrieved from Database on execution of query. Default value may sometimes restrict the actual number of records to be fetched. After that, maximum 100,000 records can be set in this fields for now. If you try to enter more than 5000 in this field, Eclipse also informs that it may cause performance issues. Similarly, this feature is available in SAP GUI Transaction SE16 and SE16N also.

4. Execution time(Diagram 3): This time is sometimes ignored however this is very important which gives first hand information on execution performance. When programmer has to select one of the option from two or more variant of similar queries, checking execution time of each variant is a good practice before using query in the code.

5. Number of Entries(Diagram 3): This button provides number of rows to be fetched for the query in SQL Console. Similarly, this feature is available in SAP GUI Transaction SE16 and SE16N also.

6. History and Favorites(Diagram 4): Refer diagram. Queries can be saved in Favorites for later use. Therefore, Eclipse by default saves past used queries also.

Diagram 4 : History & Favorites

Index

One thought on “SQL Console with Eclipse ADT

  1. Commenting in SQL console: A double quote( “ ) just as ABAP can be used for writing comment in SQL console is having a side effect
    ” is not allowed in string literal in SQL Console

    This SQL works fine inside a SQL in SE38 created ABAP program but fails in SQL Console

    ​SELECT ( fnam~fieldname
    && ‘ TYPE’
    && ‘ ‘
    && fnam~rollname
    && ‘ , “‘
    && ftxt~ddtext ) AS TEXT
    FROM dd03l as fnam INNER JOIN dd04t as ftxt
    ON ( fnam~rollname = ftxt~rollname
    AND fnam~as4local = ftxt~as4local
    AND fnam~as4vers = ftxt~as4vers
    AND ftxt~ddlanguage = ‘E’
    AND fnam~tabname = ‘SPFLI’ )
    ORDER BY fnam~position

    Works if I change ” by #

Leave a Reply