来源资料待手动核验
项目简介
ABAP Open SQL Editor
ABAP Open SQL Editor
Open SQL Editor
Program : ZTOAD
Author : S. Hermann
Date : 31.12.2017
Version : 5.0.1
This is just a clone of the original ZTOAD, an Open SQL editor.
The original ZTOAD version is available as a SAPlink nugget and can be installed on a SAP System with SAPlink.
This version can easily be installed on a SAP System with abapGit.
For local checks, TDD, the two-system development workflow, native abapGit synchronization, and live validation, see CONTRIBUTING.md, docs/test-strategy.md, and the current baseline findings.

This program allow you to execute query directly on the server
Features : The top center pane allow you to write your query in ABAP SQL format. Query can be complex with JOIN, UNION and subqueries. You can write query on several lines. You could also add spaces. To add comment, start the line by * or prefix your comment by "
You could write several queries in the query editor, separated by dot ".". To execute one of them, highlight all the wanted query, or just put the cursor anywhere inside the wanted query. By default, the last query is executed.
In case of error, you can display generated code to help you to correct your query (only if you have S_DEVELOP access)
F1 Help is managed to help you on ABAP SQL Syntax Code completion is also available :
The top left pane allow you to store your query :
The top right pane display ddic object that is currently used to help you to write the proper query Synergy with ZSPRO program : display tables defined in ZSPRO in the ddic tree Tips : You can search a table in the tree using header clic
The complete saved-query/DDIC/multi-tab workspace is available in desktop SAP GUI. SAP GUI for HTML uses a deliberately smaller, tested mode: an initially empty query editor, stream transfer with deterministic execution of the last statement, ALV results, Help, and Exit. Initial templates, cursor/selection execution, saved-query and DDIC trees, automatic history, generated-code display, downloads, options, import/export, and multiple tabs remain desktop-only until each frontend operation has its own WebGUI integration test.
Managed queries
SELECT, INSERT, UPDATE, DELETE
About New SQL Query Syntax You could use new syntax (if your SAP system manage it) ZTOAD autmatically detect if you are using new sytax when:
Select Clause managed
SELECT [DISTINCT / SINGLE] select clause
FROM from clause
[UP TO x ROWS]
[WHERE cond1]
[GROUP BY fields1]
[HAVING cond2]
[ORDER BY fields2]
[UNION SELECT...]
UP TO (Default max rows) ROWS is applied if omitted.
Every multirow SELECT is limited to 1-10,000 rows. UP TO 0 ROWS, invalid
limits, and explicit values above 10,000 are rejected before execution. A saved
default of zero or a negative value safely falls back to 100; a larger saved
default is capped at 10,000.
COUNT, AVG, MAX, MIN, SUM are managed
DO NOT FORGET SPACE in ( ) of aggregat
Insert special syntax In ABAP, insert query is always used with given structure In this SQL editor, you have 2 ways to do an INSERT :
By passing each value, 1 by 1
INSERT SEOCLASSTX VALUES ( 'ZZMACLASS', ' ', 'Test claSS' )
By passing value of used fields only
INSERT SEOCLASSTX SET CLSNAME = 'ZZMACLASS' DESCRIPT = 'TeSt class'
Native SQL is intentionally rejected. Database-specific statements belong in audited database-administration tooling, not in ZTOAD.
SELECT SINGLE * FROM VBAP WHERE VBELN = '00412345678'
SELECT COUNT( * ) SUBC MAX( PROG ) FROM TRDIR GROUP BY SUBC
SELECT VBAK~* from VBAK UP TO 3 ROWS ORDER BY VKORG.
SELECT T1~VBELN T2~POSNR FROM VBAk AS T1
JOIN VBAP AS T2 ON T1~VBELN = T2~VBELN
INSERT SEOCLASSTX VALUES ( 'ZZMACLASS', ' ', 'Test claSS' )
INSERT SEOCLASSTX SET CLSNAME = 'ZZMACLASS' DESCRIPT = 'TeSt class'
UPDATE SEOCLASSTX SET DESCRIPT = 'txt' WHERE CLSNAME = 'ZZMACLASS'
DELETE SEOCLASSTX WHERE CLSNAME = 'ZZMACLASS'
You could define your authorization object to restrict function usage by user.
If you dont define auth object, all users will have same access as defined bellow.
The auth object have 2 fields TABLE and ACTVT
ACTVT can take 4 values that you could define here.
By default :
The Authorization object name ist ZTOAD_AUTH.
Alternatively, you could define your authorization in code.
First, make the auth_object object initial.
auth_object(20) TYPE c VALUE 'ZTOAD_AUTH',
auth_object(20) TYPE c VALUE '', " 'ZTOAD_AUTH',
No you define globally the authorizations:
* Bellow is default AUTH used if no auth_object is defined
* Allow SELECT query on SAP table (restricted by given pattern)
auth_select TYPE string VALUE '*',
* Allow INSERT query on SAP table (restricted by given pattern)
auth_insert TYPE string VALUE space, "'*',
* Allow UPDATE query on SAP table (restricted by given pattern)
auth_update TYPE string VALUE space, "'*',
* Allow DELETE query on SAP table (restricted by given pattern)
auth_delete TYPE string VALUE space, "'*',
* Deprecated and ignored; Native SQL cannot be enabled
auth_native(1) TYPE c VALUE space, "abap_true,
ZTOAD_AUTH