SAP ABAP — Basic Syntax

Feyza DERİNOĞLU
3 min readMay 17, 2020

Basic Syntax

Each ABAP statement starts with an ABAP keyword and ends with a period. Keywords must be separated by at least one space.

The first line in the ABAP program begins with the word REPORT. As and when you execute the program you have to start with the first line of the word REPORT only. The program name which was created previously is followed by the statement and the line ends with a period.

Statements consist of a command and any variables and options, ending with a period. It is this period that marks where the statement finishes.

SAP ABAP is not a case sensitive program. The result of the encoding data is the same.

How to use comments in the SAP-ABAP?

Comments can be placed anywhere in the program by two methods.

· Comments are indicated by placing an asterisk (*) in the first position of the line, in which case the entire line is considered by the system to be a comment.

· Also we could use double quote (“) after a statement for comment.

Collectively Commenting the Code

We could convert the code with “Ctrl + <” also by following the Format → Comment Out Lines.

Colon Notation

If you want to write series of statements at a time, you can give the statements together with the colon (:) operator and commas. Consecutive statements can be chained together if the beginning of each statement is identical.

Here is an example of a program that could be written using colon statement:

Using colon it can rewrite as

In the bellow example you can see the statements which are identical written in a single line using colon.

Inserting lines usage in ABAP PROGRAM?

THE ULINE command by default inserts a horizontal line ın the program. This command helps of the controlling in the position and length of the line.

Syntax:

ULINE — writes a continuous underline in a new line.

ULINE AT starting_position(length) writes an underline from the starting_position of the length specified.

Example :

REPORT Z_ABAP_DEVELOPER_TEST

WRITE ‘Underlined Text Example…!!’.

ULINE.

ULINE AT 6(10).

Output:

--

--

Feyza DERİNOĞLU

SAP Tutorials - Industrial Engineer & Software Developer & Management İnformation System and Engineering 👩🏻‍💻