| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Name | Name | Last commit date | ||
|---|---|---|---|---|
Explore ABAP syntax in a nutshell & executable examples
How to Use
·
Cheat Sheets
·
Examples
ABAP cheat sheets1 ...
provide a collection of information on selected ABAP topics in a nutshell for your reference.
focus on ABAP syntax in the restricted ABAP language version ABAP for Cloud Development, particularly in the SAP BTP ABAP Environment.
include code snippets.
are supported by easy-to-consume demonstration examples that you can import into your system using abapGit to run and check out ABAP syntax in action in simple contexts:
| Branch | Environment | ABAP language version | Notes |
|---|---|---|---|
| main | SAP BTP ABAP Environment | ABAP for Cloud Development | Contains the main examples of the ABAP cheat sheet repository |
| rap | SAP BTP ABAP Environment | ABAP for Cloud Development | Features a selection of simplified, non-semantic demo RAP BOs designed to illustrate various RAP-related features, syntax, and concepts. Find more information here. The examples are related to the RAP BDL and ABAP EML cheat sheets. |
| v755, v756, v757, v758, v816 | System that supports classic ABAP (the branch names indicate the ABAP release version) | Standard ABAP | Contains many of the main examples and includes examples for classic ABAP only topics such as dynpro |
| unit_tests | SAP BTP ABAP Environment | ABAP for Cloud Development | Features a selection of simplified ABAP Unit test scenarios across various contexts in a separate branch; see the ABAP Unit Tests cheat sheet |
| oo_patterns | SAP BTP ABAP Environment | ABAP for Cloud Development | Contains example classes to illustrate object-oriented design patterns in a separate branch; see the ABAP Examples Using Object-Oriented Design Patterns cheat sheet |
are enriched by links to glossary entries and chapters of the ABAP Keyword Documentation (the F1 help) and more for you to deep dive into the respective ABAP topics and get more comprehensive information.
Important
Note
| Cheat Sheet | Topics Covered | Demo Example |
|---|---|---|
| ABAP for Cloud Development | Briefly outlines the terms ABAP Cloud and classic ABAP to set the context for ABAP for Cloud Development | zcl_demo_abap_cloud_excursion (see the notes in the cheat sheet) |
| Data Types and Data Objects | Contains basic information about data types and data objects in ABAP | zcl_demo_abap_dtype_dobj |
| Internal Tables | Creating, filling, reading from, sorting, modifying internal tables | zcl_demo_abap_internal_tables |
| Structures | Some basics when working with structures | zcl_demo_abap_structures |
| ABAP SQL | Reading from database tables using SELECT, changing data in database tables using INSERT, UPDATE, MODIFY and DELETE | zcl_demo_abap_sql |
| ABAP Object Orientation | Working with objects and components, concepts such as inheritance, interfaces, and more | |
| Constructor Expressions | Covers constructor expressions with operators such as VALUE, CORRESPONDING, NEW, CONV, EXACT, REF, CAST, COND, SWITCH, FILTER, REDUCE, iteration expressions with FOR, LET expressions | zcl_demo_abap_constructor_expr |
| Dynamic Programming | Covers field symbols and data references as supporting elements for dynamic programming, dynamic ABAP syntax components, runtime type services (RTTS), i. e. runtime type identification (RTTI) and runtime type creation (RTTC) | zcl_demo_abap_dynamic_prog |
| String Processing | Creating strings and assigning values, chaining strings, string templates, concatenating, splitting, modifying strings, searching and replacing | zcl_demo_abap_string_proc |
| ABAP for RAP: Entity Manipulation Language (ABAP EML) | Setting EML in the context of RAP, standard (create, read, update, delete) and non-standard operations (actions) |
|
| RAP Behavior Definition Language | Highlights key features and syntax options of the RAP Behavior Definition Language (BDL) for designing RAP behavior definitions (BDEF) | The ABAP cheat sheets GitHub repository features simplified, non-semantic demo RAP business objects (BOs) in the rap branch for exploring a selection of various RAP-related features, syntaxes and concepts in simplified, non-real-world contexts. Topics include managed and unmanaged RAP BOs, draft-enabled RAP BOs, numbering concepts like early and late numbering, field-specific characteristics, standard operations (CRUD), actions as non-standard operations, authorizations, local RAP business events, and more. |
| Excursion Down to Bits and Bytes | Covers the technical background of data types and data objects | - |
| ABAP SQL: Working with Hierarchies | Summarizes the functions ABAP SQL offers together with ABAP CDS for working with hierarchical data that is stored in database tables | - |
| Internal Tables: Grouping | Covers the GROUP BY clause in statements for internal tables. | zcl_demo_abap_sql_group_by |
| ABAP Managed Database Procedures (AMDP) | Covers ABAP Managed Database Procedures (AMDP): AMDP Procedures and AMDP Functions (including CDS Table Functions) | zcl_demo_abap_amdp |
| Program Flow Logic | Deals with control structures (IF, CASE), loops (DO, WHILE) | zcl_demo_abap_prog_flow_logic |
| Logical Expressions and Functions | Covers logical expressions and functions that are used to process data based on specific conditions and to control program flow. | - (The cheat sheet includes code snippets) |
| ABAP Unit Tests | Contains basic information about unit testing in ABAP | zcl_demo_abap_unit_test Note the examples in the unit_tests branch of the ABAP cheat sheets GitHub repository. |
| CDS View Entities | The cheat sheet provides references to information on ABAP CDS. Find a feature table for available language elements in ABAP CDS in the ABAP Keyword Documentation with links to detailed topics. The focus here is on the example CDS artifacts and the executable example class, which include comments. | zcl_demo_abap_cds_ve |
| SAP LUW | Provides a high-level overview of the SAP LUW concept that deals with data consistency with a focus on SAP LUW-related statements 💡 Several statements covered in the cheat sheet and the executable example are only relevant to Standard ABAP. |
Program ZDEMO_ABAP_SAP_LUW |
| Dynpro | Provides a high-level overview of dynpro topics with a focus on dynpro-related statements 💡 The content of this cheat sheet and the executable example are only relevant to Standard ABAP. |
Program ZDEMO_ABAP_DYNPRO |
| Selection Screens and Classic Lists | Provides a high-level overview of selection screens and classic lists with a focus on related statements. It includes an excursion into the SAP List Viewer (ALV). 💡 The content of this cheat sheet and the executable examples are only relevant to Standard ABAP. |
Program ZDEMO_ABAP_SELSCR_LISTS_INTRO (the "intro" program, from which the other related example programs can be started) |
| Working with XML and JSON in ABAP | Covers processing XML using class libraries, XML transformations using XSLT and Simple Transformations (ST), serializations (ABAP to XML) and deserializations (XML to ABAP), dealing with JSON data | zcl_demo_abap_xml_json |
| Released ABAP Classes | Contains a selection of ABAP classes, serving as a quick introduction, along with code snippets to explore the functionality in action | - (The cheat sheet includes copy and paste code snippets and example classes) |
| Date, Time, and Time Stamp | Covers how to handle and process dates, times, and time stamps in ABAP | zcl_demo_abap_date_time |
| Built-In Functions | Covers a variety of built-in functions in ABAP | zcl_demo_abap_builtin_func |
| Authorization Checks | Provides a high-level overview of explicit and implicit authorization checks in ABAP | - (The cheat sheet includes a copy and paste example class) |
| ABAP Dictionary | Covers a selection of repository objects in the ABAP Dictionary (DDIC) that represent global types | - (The cheat sheet includes a copy and paste example class) |
| Exceptions and Runtime Errors | Provides an overview on exceptions and runtime errors | zcl_demo_abap_error_handling |
| Regular Expressions in ABAP | Includes an overview of common regular expressions and their use in ABAP through statements, built-in functions, and system classes | zcl_demo_abap_regex |
| Numeric Operations in ABAP | Explores various aspects of numeric operations and calculations in ABAP | zcl_demo_abap_numeric_op |
| Generative AI | Provides references to detailed information on Generative AI in ABAP Cloud and explores released ABAP classes available in the ABAP AI SDK powered by Intelligent Scenario Lifecycle Management | - (The cheat sheet includes a copy and paste example class) |
| WHERE Conditions | Explores syntax options in ABAP statements that include WHERE for data filtering | zcl_demo_abap_where_conditions |
| Performance Notes | Explores a selection of performance-related examples, aimed to illustrate potentially inefficient techniques and use of statements | - (The cheat sheet includes a copy and paste example class) |
| ABAP Release News | Summarizes the release news from the ABAP Keyword Documentation for both versions of the ABAP language, ABAP for Cloud Development and Standard ABAP | - |
| ABAP Examples Using Object-Oriented Design Patterns | Does not cover ABAP-specific topics, but rather focuses on ABAP code experiments that explore design patterns in object-oriented programming. Many of these experiments are inspired by classic design patterns established by the Gang of Four (GoF). | The cheat sheet includes copy and paste example classes. These are included in the oo_patterns branch of the repository. Find more information here. |
| Enhancements Using BAdIs | Provides a high-level overview of enhancements using BAdIs (Business Add-Ins), focusing on related ABAP syntax. | - (The cheat sheet includes copy and paste example classes as well as descriptions to create demo BAdIs step by step) |
The main focus of the ABAP cheat sheets is ABAP for Cloud Development. The examples in the main branch of the repository are designed to be imported into the SAP BTP ABAP environment. For Standard ABAP, you can find examples in the other branches of the repository (note that except for specific examples, the example code there uses syntax that is also availabe in ABAP for Cloud Development) that you can import into your sandbox SAP system. Just select the appropriate version (v757 stands for ABAP version 7.57). Check the information in the following collapsible sections for your system environment and perform the required steps.
🟢 1) General infoPrerequisites
Import Code
Use the abapGit plug-in to install the ABAP cheat sheets by carrying out the following steps:
In your ABAP cloud project, create a package, for example, ZABAP_CHEAT_SHEETS as the target package. The package should be local.
Add the package to the Favorite Packages in the Project Explorer view in ADT.
To add the abapGit Repositories view to the ABAP perspective, choose Window → Show View → Other... from the menu bar and choose abapGit Repositories.
In the abapGit Repositories view, click the + icon in the upper right corner of the ADT tab to link a new abapGit repository.

The Link abapGit Repository popup appears. Enter the following URL:
https://github.com/SAP-samples/abap-cheat-sheets.git
Choose Next.
On the Branch and Package Selection screen, enter the name of the created package (for example, ZABAP_CHEAT_SHEETS) in the Package field.
Choose Next.
On the Select Transport Request screen, choose Finish to link the Git repository to your ABAP cloud project. The package should be local.
In the abapGit Repositories view, filter for your package. The repository appears in the abapGit Repositories view with the status Linked.
Right-click on the new abapGit repository and choose Pull... to start the cloning of the repository contents.
On the Branch and Package Selection screen, choose Next.
If the Locally Modified Object screen is displayed, select the objects (for example, the package to automatically select all artifacts) from the list and choose Next.
On the next screen - the package should be local - choose Finish. Same as above, if an object already locked message is displayed, choose Finish as well. The status in the abapGit Repositories view changes to Pull running.... Note that the pull run may take several minutes.
Once the cloning is complete, the status changes to Pulled Successfully. You may need to refresh the abapGit Repositories view to see the progress of the import. To do this, choose the Refresh icon in the upper right corner of the view.
Refresh your project tree. For example, in ADT, right-click the package and choose Refresh. The package should contain all the artifacts from the GitHub repository.
Make sure that all artifacts are active. To activate all inactive development objects, choose the Activate all inactive ABAP development objects button from the menu (or choose CTRL+Shift+F3).
Prerequisites
DATA rel LIKE sy-saprl.
rel = sy-saprl.
BREAK-POINT.Import Code
Use the standalone version of the abapGit report to import the demo examples of the ABAP cheat sheets by performing the following steps:
Git Repository URL:
https://github.com/SAP-samples/abap-cheat-sheets.git
Package: Your demo package, for example, TEST_ABAP_CHEAT_SHEETS
Branch: Choose the button with the 3 dots to the right of the input field. In the pop-up window, select the appropriate branch, e.g. v757 if your ABAP release is 7.57, and choose the Continue (✔️) button. Note: The examples in the main branch are designed to be imported into the SAP BTP ABAP environment only.
Folder Logic: Full
Open the package you created containing the imported ABAP artifacts in the ABAP development tools for Eclipse (ADT).
Classes:
Open one of the ABAP cheat sheet example classes listed in the ABAP Cheat Sheets Overview section, for example, zcl_demo_abap_string_proc. The classes are located in the Source Code Library → Classes folder.
Choose F9 to run the class. Alternatively, choose Run → Run As → 2 ABAP Application (Console) from the menu.
Check the console output.
[!NOTE]
- Check the notes on the context and the ABAP syntax used that are included as comments in the class.
- Due to the amount of output in the console, in many cases, the variable name is displayed in the console. Therefore, to find the relevant output in the console more easily and quickly, simply search the console for the variable name, or use breakpoints in the code to check variables in the debugger.
- Many of the example classes are structured as follows:
- Code snippets are organized by topic within dedicated methods (m01_..., m02_..., m03_..., and so on) to avoid overcrowding in the if_oo_adt_classrun~main method implementation. The if_oo_adt_classrun~main method must be implemented when specifying the if_oo_adt_classrun interface. It enables a class to be executed and display data object content (using the out->write( ... ) method call).
- These methods, named with an M followed by a digit, are called dynamically in the if_oo_adt_classrun~main method implementation. The method names are retrieved into an internal table using Runtime Type Identification (RTTI). For more information on RTTI, refer to the Dynamic Programming cheat sheet.
- The table is iterated over, and only methods that follow the naming convention are called. The interface reference variable out, which is bound when executing the class, is passed to the individual methods to enable displaying data object content.
- You may want to clear the console by right-clicking in the console and choosing Clear before running another demo class to avoid confusing the output of multiple classes. Note that you can also add a setting to automatically clear the console.
Classic programs (reports):
The code examples presented in this repository are only syntax examples and are not intended for direct use in a production system environment. The code examples are primarily intended to provide a better explanation and visualization of the syntax and semantics of ABAP statements and not to solve concrete programming tasks. For production application programs, a dedicated solution should therefore always be worked out for each individual case. There is no guarantee for either the correctness or the completeness of the code. In addition, there is no legal responsibility or liability for possible errors or their consequences, which occur through the use of the example code.
This is not intended to be a contribution repository, so please do not create pull requests. If you like to address issues, please create an issue. However, this project is provided "as-is": there is no guarantee that raised issues will be answered or addressed in future releases.
Copyright (c) 2026 SAP SE or an SAP affiliate company. All rights reserved. This project is licensed under the Apache Software License, version 2.0 except as noted otherwise in the LICENSE file.
"A written [...] aid (such as a sheet of notes) that can be referred to for help in understanding or remembering something complex" (Definition for "cheat sheet" in Merriam-Webster Dictionary). ↩
| Back | FazBrowse Home | New Git URL |