ABAP Language Versions – FAQs
In this blog post, I want to provide some answers for frequently asked questions on ABAP Language Versions.
1. What is an ABAP language version?
An ABAP language version is a subset of the full ABAP language set. It provides:
- Restricted syntax: only a well-defined part of the ABAP syntax tree is allowed in a specific ABAP language version. In other words, either complete statements are forbidden (e.g. EXEC SQL) or parts of a statements (e.g. SELECT USING CLIENT)
- Released object check: only released SAP APIs (for example releases classes and CDS views) can be used. Precisely speaking, the ABAP language version restricts the access to objects (ABAP classes, interfaces, tables, CDS views, …) which are either part of the same software component or that are released for the respective ABAP language version
2. What is the goal of an ABAP language version?
The concept of ABAP language versions supports two targets:
- Minimize the risk of damages to the system or the data integrity/security
- De-couple custom code from the SAP core by enforcing the exclusive use of released SAP APIs
3. Which ABAP language versions are available?
As of today, the following three ABAP language versions are available for custom development and key user tools:
|ABAP Language Version||SAP BTP ABAP Environment
|SAP S/4HANA Cloud ABAP Environment (aka Embedded Steampunk,
available with 2208)
|SAP S/4HANA 2022 (on-premise)|
|Standard||Not available||Not available||Available|
|ABAP for Cloud Development||Available||Available||Available|
|ABAP for Key User||Available||Available||Available|
In older on-premise releases, some obsolete language versions are available (e.g. non-unicode ABAP). These are obsolete since some years and have been cleaned out with 2022.
Historically, the concept of ABAP language version was introduced to distinguish between Unicode and non-unicode ABAP. Later the ABAP language version ABAP for Key Users was introduced for the use in key user tools which are available in S/4HANA Cloud and on-premise (see S/4HANA Extensibility Concept Details: Restricted ABAP ). Then, the ABAP language version ABAP for SAP Cloud Platform was introduced for the SAP BTP ABAP Environment (aka Steampunk) (see Restricted ABAP for SAP BTP ABAP Environment). Later, this language version was renamed to ABAP for Cloud Development, because this language version today is not only used with SAP BTP but also in SAP S/4HANA Cloud (aka Embedded Steampunk, see: Steampunk is going all-in | SAP Blogs ); it can also be used in on-premise ( Restricted ABAP and SAP S/4HANA On-Premise ).
4. How do I set the ABAP language version?
The ABAP language version can be set in the ABAP Developer Tools (ADT) in the Properties tab. In 2022, the ABAP language version field is shown in the Properties -> General tab.
In older releases it is shown in the tab Properties -> Specific.
The language version can be changed in on-premise only. In Cloud, the ABAP language version is set by the system and cannot be changed. The ABAP language version ABAP for key users is set by the key user tools, so normally you will not change the ABAP language version from/to ABAP for Key in ADT.
The ABAP language version is a property of the respective ABAP object. It is in principle independent of the tool in which the object is maintained (ABAP workbench, ADT, key user tool).
The ABAP language version can be defaulted for a package or a software component. For Cloud products (SAP BTP, SAP S/4HANA Cloud), the configuration is managed by the system.
5. What is the effect of the ABAP language version?
When an ABAP language version (<> Standard) is set for an ABAP object, the syntax check is enhanced by additional checks, which prevent the use of “forbidden” statements and non-released objects from other software components. In other words, objects using “forbidden” statements or non-released objects cannot be activated.
6. Which object types support an ABAP language version?
The ABAP language version is not only supported for ABAP “code” objects (classes, interfaces, …) but also for other object types of the “modern ABAP world”:
- DDIC: domains, data elements, structures, tables, …
- CDS/RAP: CDS views and entities, behavior definitions, …
- Authorization: Authorization objects/fields/default values, …
- Re-use services: number range, change document, …
The language version enablement was completed for most object types in version 2208/2022. In the 2208/2022 version, you can find the language version field in ADT in the Properties -> General tab for all object types that support the ABAP language version.
In previous releases, the ABAP language version was supported for ABAP “code” objects (classes, interfaces, …). The language version field in ADT is located in the Properties -> Specific tab for these objects.
7. Which statements are supported in the ABAP language version?
For ABAP “code” objects (classes, interfaces, …), the list of statements or “sub-statements” can be found in the documentation:
ABAP for Key Users: Statements in ABAP for Key Users
ABAP for Cloud Development: ABAP Keyword Documentation
The following table provides an overview on development topics that are supported in the ABAP language versions.
|Topic||ABAP for Cloud Development||ABAP for Key Users|
|Basic data manipulation and flow control, working with internal tables (e.g. IF, CASE, WHILE, DO, TRY, DATA, TYPES, CONCATENATE, ASSIGN, APPEND, LOOP, SELECT, READ, …)||Supported||Supported|
|Selecting from CDS views (SELECT)||Supported||Supported|
|Select from custom tables, write to custom tables||Supported||Not supported|
|Creation and call of ABAP classes||Supported||Supported|
|Creation and call of ABAP function modules||Supported||Not supported|
|Access system variables (SY-)||Partly supported. Use APIs, e.g. class CL_ABAP_CONTEXT_INFO||Partly supported. Use APIs, e.g. class CL_ABAP_CONTEXT_INFO|
|Dynamic programming||Supported. Note that the release check for used objects will be executed at runtime and will result in a runtime error, if a not released object is called.||Not supported|
|Code (object) generation||Supported. Use XCO Generation APIs||Not supported|
|Asynchronous programming||Supported. But statement like CALL FUNCTION … STARTING NEW TASK, RECEIVE, WAIT are no longer supported. Use API CL_ABAP_PARALLEL.||Not supported|
|Providing and implementing extensions||Supported: CALL BADI, GET BADI. Obsolete extension technology is not supported, e.g. ENHANCEMENT-POINT||Not supported|
|Statements for REPORT and DYNPRO processing (e.g. REPORT, CALL SCREEN, …)||Not supported||Not supported|
|Access to the file system, low level access to the database, statements that would endanger the operations in the Cloud (e.g. OPEN DATASET, EXEC SQL, OPEN/CLOSE CURSOR, SELECT CLIENT SPECIFIED, SELECT USING CLIENT, SYSTEM CALL)||Not supported||Not supported|
|Obsolete ABAP statements (e.g. COMPUTE, DESCRIBE TABLE LINES, FREE/REFRESH)||Not supported||Not supported|
8. Which APIs/objects can be used in an ABAP language version?
The ABAP language version restricts the access to objects (ABAP classes, interfaces, tables, CDS views, …) which are either part of the same software component or that are released for the respective ABAP language version. The information on the release state is shown in ADT in the Properties -> API State tab.
9. Can I see objects with ABAP language version ABAP for Key Users in ADT?
Yes. You can see and also debug code written in key user tools in ADT. Details see: Key User Debugging
10. Can I change the ABAP language version ABAP for Key Users in ADT?
In on-premise you can set the ABAP language version ABAP for Key Users in ADT. However normally this language version is used and set automatically by the key user tools. So normally you will change the ABAP language version from/to ABAP for Key Users for test objects only.
11. Can I execute the ABAP language version checks using ATC?
Yes. You can use the ATCs ABAP Language Version Check and Usage of Released APIs in the Cloud Readiness check group to check the syntax and usage of released APIs for objects, before changing the ABAP language version. Learn more in the following blog: How to check your custom ABAP code for SAP BTP ABAP Environment
12. How can I adapt legacy custom code towards the new ABAP Language Version?
The ABAP Test Cockpit in Eclipse offers Quick fixes to automate the adaptation of custom code and transforms old ABAP statements towards the new version, e.g. adaptation to the new SQL syntax. See: Learn more about it: Semi-automatic custom code adaptation for SAP BTP ABAP