ABAP stands for “Advanced Business Application Programming”. It is a programming language for developing applications for the SAP R/3 system.
The latest version of ABAP is called ABAP Objects and supports object-oriented programming. SAP can run applications written with ABAP/4, an earlier version of ABAP, as well as applications that use ABAP Objects.
Without further ado, let’s start learning ABAP.
Note, this tutorial won’t go into detail about the structure of the ABAP language (which can be boring to read), but will introduce the key concepts so you can get started quickly and focus on the most important topics. more important topic.
Datatypes
Syntax for declaring a variable in ABAP
1 2 | DATA Tên_Biến Type Kiểu_Biến |
Example:
1 2 | DATA employee_number Type I. |
Below is a list of data types supported by ABAP
DataType | Initial field length | Valid field length | Initial value | Meaning |
---|---|---|---|---|
Numeric types | ||||
I | 4 | 4 | 0 | Internet (whole number) |
F | 8 | 8 | 0 | Floating point number |
P | 8 | 1 – 16 | 0 | Packed number |
Character types | ||||
OLD | first | 1 – 65535 | ‘…’ | Text field(alphanumeric characters) |
EASY | 8 | 8 | ‘00000000’ | Date field(Format: YYYYMMDD) |
WOMEN | first | 1 – 65535 | ‘0…0’ | Numeric text field(numeric characters) |
BILLION | 6 | 6 | ‘000000’ | Time field(format: HHMMSS) |
Hexadecimal type | ||||
X | first | 1 – 65535 | X’0 … 0′ | Hexadecimal field |
Data processing
Assign Value
1 2 3 4 5 6 | a=16. move 16 to a. write a to b. |
Arithmetic Operations
1 2 | compute a = a*100. |
Control Statements
The following control statements can be used
– If… EndIf Loop
1 2 3 4 5 6 7 8 | if [not] exp [ and / or [not] exp ]. ........ [elseif exp. .......] [else. .......] Endif. |
– Case statement
1 2 3 4 5 6 7 8 9 10 | Case variable. when value1. ......... when value2. ......... [ when others. .........] Endcase. Do. |
– While loop
1 2 3 4 5 | While <logical expression>. ..... ..... Endwhile. |
– Due to loop
1 2 3 4 5 | Do <n> times. ..... ..... Enddo. |
Logical Operator
List of logical operators
- GE or >=
- GT or >
- LE or <=
- LT or <
- EQ or =
- NE or <>
ABAP/4 Editor
Ultimately, this is where you will spend the most time as a developer creating/modifying programs. Transaction SE38
source: guru99.com