ABAP REPL¶
Run short ABAP snippets on a connected development or test system and view their output directly in VS Code.
How It Works¶
Each time you run a snippet, the SAP-side REPL service:
- Creates a temporary ABAP report with
INSERT REPORT. - Compiles it with
GENERATE REPORT. - Executes it with
SUBMITand captures the list output. - Deletes the temporary report immediately after execution.
The code runs on the selected SAP system under your own user and authorizations. It is not a local ABAP interpreter.
Development and test systems only
The REPL refuses to execute unless both SAP and ABAP FS identify the target as non-production. If the production status cannot be verified, execution is blocked.
SAP-Side Setup¶
The REPL requires:
- Class
ZCL_ABAP_REPL, implementingIF_HTTP_EXTENSION. - Active SICF service
/sap/bc/z_abap_repl, handled byZCL_ABAP_REPL. S_DEVELOPauthorization for the executing user.S_ICFaccess to thez_abap_replservice.
Run ABAP FS: ABAP REPL Setup Guide from the Command Palette for the class source and detailed SAP setup steps.
Running Code¶
- Open the Command Palette (
Ctrl+Shift+P). - Run ABAP FS: Execute ABAP Code.
- Read and accept the execution notice.
- Select a connected SAP system.
- Enter a snippet, such as:
- Run the snippet and review its output, errors, and execution time in the panel.
The panel checks that the REPL service is available before every execution. Only one snippet can run at a time, and each request has a 60-second timeout.
Security and Auditing¶
- Executed code has the same authorization scope as your SAP user.
- Production clients are blocked.
- Every execution can be recorded in application log object
ZREPL, subobjectEXEC. - Temporary reports are deleted after execution; no persistent code artifact is intentionally retained.
- The optional application log requires object
ZREPLand subobjectEXECto be created in transactionSLG0.
Because this feature executes arbitrary ABAP on a live SAP system, review every snippet before running it.
Removing the Service¶
Deactivate and delete SICF service z_abap_repl, then delete class ZCL_ABAP_REPL. No database or configuration tables are used by the REPL.