Skip to Content
Technical Articles
Author's profile photo Daniel Reger

ABAP Cheat Sheets

Hi ABAP folks,

There‘s a popular internet meme out there: “One does not simply …”.
It comes from the statement “One does not simply walk into Mordor” made by Boromir, a member of the fellowship in the first Lord of the Rings movie, who is doubtful about the mission‘s prospects of success regarding the destruction of the one ring in Mount Doom – a volcano 🌋 in the realm of Mordor.

Maybe you were or are faced with a similarly tough mission when dealing with or learning ABAP. You could well argue that one does not simply understand ABAP 😅.

How about some info and code snippets on dedicated ABAP topics, concepts and syntax in a nutshell to get some basic equipment on the mission when advancing (certainly less belligerently than the fellowship mentioned above) into the realm of ABAP 🤔?

ABAP Cheat Sheets are there to support you!

 

🔗 https://github.com/SAP-samples/abap-cheat-sheets

 

No, it’s not about foul tricks and cheating. And no teacher will disapprove.
According to Merriam-Webster Dictionary 📚, a cheat sheet is a “a written […] aid (such as a sheet of notes) that can be referred to for help in understanding or remembering something complex”.

What are ABAP Cheat Sheets?

They …

  • provide a collection of information on selected ABAP topics in a nutshell for your reference.
  • focus on ABAP syntax, keywords and additions to ABAP statements.
  • include code snippets.
  • are supported by easy-to-consume demonstration examples that you can import into your SAP BTP ABAP environment or on-premise ABAP system using abapGit for you to run and check out ABAP syntax in action in simple contexts.
  • do not claim to be fully comprehensive as far as the concepts and syntax options are concerned. Since they are enriched by links to glossary entries and chapters of the ABAP Keyword Documentation (the F1 help), they invite you to dig deeper into the respective topics in the ABAP Keyword Documentation.

Currently available cheat sheets

 

Cheat Sheet Topics Covered
Working with Internal Tables Creating, filling, reading from, sorting, modifying internal tables
Working with Structures
  • Creating structures and structured types
  • Variants of structures
  • Accessing components of structures
  • Filling and clearing structures
ABAP SQL in Use
  • Reading from database tables using SELECT
  • Changing data in database tables using INSERTUPDATEMODIFY and DELETE
ABAP Object Orientation Working with objects and components, concepts like inheritance, interfaces, and more
Working with Constructor Expressions
  • Operators VALUE, CORRESPONDING, NEW, CONV, EXACT, REF, CAST, COND, SWITCH,  FILTER, REDUCE
  • Iteration expressions with FOR
  • LET expressions
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)
String Processing
  • Creating strings and assigning values
  • Chaining strings
  • String templates
  • Concatenating, splitting, modifying strings
  • Searching and replacing
  • Regular expressions
ABAP for RAP: Entity Manipulation Language (ABAP EML)
  • Setting EML in the context of RAP
  • Standard operations (create, read, update, delete)
  • Non-standard operations (actions)
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
ABAP SQL: Grouping Internal Tables Touches on the GROUP BY clause in ABAP SQL
A Glimpse on AMDP Covers ABAP Managed Database Procedures (AMDP): AMDP Procedures and AMDP Functions (including CDS Table Functions)
Program Flow Logic Deals with control structures (IF, CASE), loops (DO, WHILE) and exception handling
A Glimpse on ABAP Unit Tests Contains basic information about unit testing in ABAP
CDS View Entities Note that cheat sheet content is available in this blog. See examples in the repository. These include comments.

Do you spot any errors? Any suggestions for further snippets and cheat sheets?
Cheers.

Assigned Tags

      33 Comments
      You must be Logged on to comment or reply to a post.
      Author's profile photo Mohammed Altarkawi
      Mohammed Altarkawi

      Very useful, thank you!

      Author's profile photo Daniel Reger
      Daniel Reger
      Blog Post Author

      Thanks a lot Mohammed! 👍

      Author's profile photo Jens Zähringer
      Jens Zähringer

      Wow, that's really a lot of content.
      I just had a quick look and it looks really very useful. Thank you for your effort for creating these Cheat-Sheets for various ABAP-related topics 🙂

      Kind regards
      Jens

      Author's profile photo Daniel Reger
      Daniel Reger
      Blog Post Author

      Hi Jens,

      very welcome. Thank you.

      Cheers

      Author's profile photo Christopher Linke
      Christopher Linke

      Wow, thank you so much for your effort!

      Author's profile photo Daniel Reger
      Daniel Reger
      Blog Post Author

      Thanks, Christoph.

      Author's profile photo Marc Bernard
      Marc Bernard

      That's for sponsoring me on GH, Christopher! Please send me an email or Twitter DM

      Thanks,
      Marc

      Author's profile photo Safa Golrokh Bahoosh
      Safa Golrokh Bahoosh

      Great Blog! Thanks, Daniel, for gathering and sharing all these useful information.

      Author's profile photo Daniel Reger
      Daniel Reger
      Blog Post Author

      Hi Safa, thanks for leaving the message. Kind regards Daniel

      Author's profile photo Radoslaw Chudziak
      Radoslaw Chudziak

      Amazing stuff. More of that please in other development areas like SAPUI5 etc.

      Author's profile photo Daniel Reger
      Daniel Reger
      Blog Post Author

      Hi Radoslaw, thanks! We're glad if F1's ABAP content is of help. 😀 Cheers

      Author's profile photo Radoslaw Chudziak
      Radoslaw Chudziak

      F1 is lacking  examples comparing to this Github repo.

      Author's profile photo Daniel Reger
      Daniel Reger
      Blog Post Author

      Please see the Further information section in the repository's readme. The package SABAPDEMOS with plenty of code examples is available in SAP systems. The descriptions of the examples regarding the context and all are accessible via the F1 documentation, too. For example, try this link (standard ABAP) out to see a list of the examples. Then just search in your system for the mentioned artifacts. When checking that out directly in the system-internal version of the ABAP Keyword Documentation, you can get to the artifacts directly. You also have the option to run the example from the system-internal version directly. Apart from that, just recently the F1 examples were made fit for the SAP BTP ABAP environment and can be explored in those environments as well.

      Author's profile photo Johann Fößleitner
      Johann Fößleitner

      Hi,

      amazing. Thank you very much.

      Lg Föß

      Author's profile photo Daniel Reger
      Daniel Reger
      Blog Post Author

      Hi Föß, thanks for your note 👍

      Author's profile photo Wises Keshom
      Wises Keshom

      this stuff is absolutely amazing, thank you so much for your efforts. 🙂

      Author's profile photo Daniel Reger
      Daniel Reger
      Blog Post Author

      Thanks Wises. ABAP rocks!

      Author's profile photo Ruthiel Trevisan
      Ruthiel Trevisan

      Thank you Daniel Reger for this work!
      It is really helpful for the community!

      Author's profile photo Daniel Reger
      Daniel Reger
      Blog Post Author

      Thanks Ruthiel! That was the plan 😁😁👍👍

      Author's profile photo Syambabu Allu
      Syambabu Allu

      Hi Daniel,

      It’s really informative blog. Thanks for sharing!!

      Thank you,

      Syam

       

      Author's profile photo Daniel Reger
      Daniel Reger
      Blog Post Author

      You're very welcome, Syam. Thanks a lot. Kind regards Daniel

      Author's profile photo Christopher Solomon
      Christopher Solomon

      Thanks for all the time and work put into this! I am sure it will be a LONG living document!

      Author's profile photo Daniel Reger
      Daniel Reger
      Blog Post Author
      Thanks for your comment, Christopher. Yes, let's see. ABAP never gets old 😎. Let's see if more topics can be added over time. Regarding ABAP topics, there's "just a tiny little bit“ more available 😂 (or 😨 respectively … 😅😅). Cheers Daniel
      Author's profile photo Olasunkanmi Adeniji
      Olasunkanmi Adeniji

      Thank you so much for this cheat-cheat.

      It really came handy to me at the right time esp the RAP topics.

      Will definitely bookmark it.

      Author's profile photo Daniel Reger
      Daniel Reger
      Blog Post Author

      Hi Olasunkanmi, great to hear that it is of help. Regarding the RAP stuff, you can consult, for example, the F1 docu here for the full beauty of CDS BDL, how to tailor your BDEF and all.  Just check the subtopics there. Furthermore, this topic serves as entry point to the F1 topics about EML. Not to forget (1): Meanwhile, there are plenty of smaller and bigger executable examples on RAP in/accessible and executable via the (system-internal) F1 docu. You find links to those examples in the respective topics (Executable Example section in the individual topics, usually the last section in the topics). Not to forget (2): The great Development guide for the ABAP RESTful Application Programming Model (<- on-premise; cloud -> here) for the complete picture. Cheers Daniel

      Author's profile photo Mike Donald Sevilla
      Mike Donald Sevilla

      big thank you! 🙂

      Author's profile photo Daniel Reger
      Daniel Reger
      Blog Post Author

      Hi Mike, 👍👍

      Author's profile photo Beyhan MEYRALI
      Beyhan MEYRALI

      Great effort! Thanks for sharing.

      Author's profile photo Daniel Reger
      Daniel Reger
      Blog Post Author

      Hi Beyhan, you're very welcome 👍 Cheers Daniel

      Author's profile photo Bärbel Winkler
      Bärbel Winkler

      Thanks for these neat Cheat Sheets, Daniel! I already shared a link to this blog post with colleagues to make them aware of them.

      Cheers

      Bärbel

      Author's profile photo Daniel Reger
      Daniel Reger
      Blog Post Author

      Hi Bärbel, awesome 👍! Thanks a lot and kind regerds Daniel

      Author's profile photo Barış Güler
      Barış Güler

      Hello Daniel,

      Thanks for this great blog. I am having problem when pull this demos to my development system. Are these errors related my system or coding ?

      Author's profile photo Daniel Reger
      Daniel Reger
      Blog Post Author
      Hi Barış,
      thanks for your kind note and for reaching out. In fact, I strongly assume that the import errors are  related to the (ABAP version in your on-premise) system and that you are on a release < 7.56 (very first error note ...not supported by your NW release). As far as I can see from the screenshot, the RAP-related artifacts, among others (e.g. BDEF), are affected. As mentioned in the readme: "[...] you may want to [...] ignore the affected artifacts if an activation fails. Note that especially the RAP examples require at least ABAP version 7.56". 
      Thanks and kind regards Daniel