First ABAP program – how to start with ABAP?
First ABAP program
The simplest way to learn ABAP (Advanced Business Application Programming – the programming language in SAP) is to start writing some code. You can try to create a simple program with ABAP editor in transaction se38.
There is a naming convention for the customer programs, which can be created in SAP system. They have to start with Z or Y.
When you press create, you will be forced to fill different program attributes like title, program type and package. If you select a package you will be forced to create transport and the program can be transported to other SAP systems.
If you don’t use package you can create a local program. The local program doesn’t require transport request, but you can’t transport it to another SAP system.
The program type can be different: Executable program, module pool, function group and others. For beginning you can start with executable program. This is a type used for example for a simple ABAP report.
After pressing create you go to the next screen where you can start writing the code.
To create your first ABAP program just write following code:
WRITE ‘Hello World!’.
Now you need to check the syntax.
Press button check syntax
(CTRL+f2). Syntax is correct and you see message in the lower left part of the screen.
Press save and press button ‘direct processing’ or f8 to execute the program.
On the next screen you should see the words ” Hello World!”. Activate your program with the button “activate” in the ABAP editor menu. (CTRL+F3)
Your first ABAP program is ready.
The ABAP program contains ABAP statements. The first word in every statement is called ABAP keyword. Every ABAP statement ends with point. There is no differentiation between upper and lowercase in keywords, additions and operands.
In the simple ABAP program you used the ABAP statement WRITE to output text.
There is very nice help for ABAP statements sysntax in the ABAP editor by pressing the button F1. See here what other help you may use.