Structure of ABAP Program
ABAP program consists the following structure
- Global Declarations
- Processing Logic
- Definition of Reusable Blocks
Header section provides the detailed information about the development and which is the standard template for all custom ABAP developments. The first statement of ABAP program starts with a word PROGRAM or REPORT. It is not mandatory to mention the program name, but for documentation purpose correct name of ABAP program should be used.
When the user creates a program, by default system inserts the first ABAP statement
- For module pools – PROGRAM <name of program>
- For executable pools – REPORT <name of report>
Global declaration declares all the global variables
Processing logic block is used to implement the business logic and it is written for declaration.
Definition of Reusable Blocks
You can define reusable components once and you can call components wherever they are need for business logic.
Pre-requisites to create an ABAP programs
- Every SAP ABAP program should have a name and should begin with a letter Y or Z. The letters from A to X is reserved for SAP programs.
- Title : – Description of the program
- Type : – Types of ABAP program are
- Executable program,
- Include program and
- module pool program.
- Package : – Package a place where the program has to be created and stored. In real time package is created for each module/sub-module but not individuals.
Characteristics of ABAP program
- ABAP programming language is not a case sensitive. But it is a space sensitive, it should have space between the programming words.
- ABAP is only case sensitive during camparison
- Every ABAP statement should end with a period (full stop).
- The program name should not contain a special characters such as ” , – ( ) “, spaces, etc.
- The program name should be unique and description length upto 30 characters long.
An Example of SAP ABAP Program
Where ABAP programs are stored?
ABAP Repository is a special memory in the database of SAP R/3 system and ABAP programs are stored in this memory.