What is ABAP Keywords?
When you want to learn a language each language having elementary keywords same way first element of ABAP statement is known as ABAP keywords. A keyword determines the ABAP categories.
ABAP keywords are the vocabulary of SAP ABAP Programming language. Any ABAP statements are composed of keywords, operands, and operators according to the predefined syntax rules.
ABAP Keywords can also contain hyphens (-) to form multiple word expressions.
ABAP keywords are not reserved names. ABAP naming conventions is not restricted, if possible we should avoid.
In a ABAP statement
DATA I_number TYPE I VALUE 211.
I Data type
VALUE 211 Literal
Structure of a program
Example of ABAP Statement coded
2. WRITE_’Hi Learner’ Welcome to SastraGeek ABAP Training
In the above ABAP statement PROGRAM and WRITE are the keywords.
The Program displays the list of screen. The list consists of ‘HI Learner’ Welcome to SastraGeek ABAP Training.
Types of ABAP Keywords?
· Declarative Keywords
· Modularization Keywords
· Control Keywords
· Call Keywords
· Operational Keywords
· Database Keywords
1) Declarative Keywords
Declarative statements use the declarative keywords to declare the data objects that are used by another ABAP statement.
Some Declarative words are
A) Data: Data keyword is one of the declarative keyword. It is used to declare the variable syntax:
We not use keyword data try save the system will give syntax error
B) Type: Type is one of the declarative keyword. It is used to declare data type of the declared variable.
Data var_name Type Data Type
Data X. Type i. (Single variable declaration)
Data Name C.
· Characters is a single letter
· We need to specify the length also
Data : X Type I,
Name (10) type c,
Address Type String.
( : )- is act as chain operator and (,) – is act continue
Above is multiple variable declarations
If we use string we not need to define character length
1 String 65782 letters
C) Constant: Type is one of the declarative keyword. It is used to declare data type of the constant data type
constants x type data i value 10.
constant y type c value welcome to SastraGeek ABAP Training
D) Types: Types is one of the declarative keyword. It is used to declare structure
Business Requirement--> customer (500)--> Customer No Customer Name- Customer Type- Customer Address information display only
Types: begins of structure_name,
End of str_name
E) Tables: Table is one of the declarative keyword. It is used to declare tables
Business Requirement--> Customer (300)--> Customer no-customer name- Customer type----etc. all fields information display
Select * from customer.
(*) --> All field info
If you wish to display any data table in ABAP program we need to declare first the data base table first
2) Modularization Keywords
Modularization statements uses modularization keyword to define the processing blocks in ABAP program. The modularization keywords are two types
A) Event Keywords: Event statements uses event keywords to define event blocks. There are no special end statements and automatically ends when another block starts.
Some keywords are;
1. AT SELECTION SCREEN
3. AT USER-COMMAND
B) Defining Keywords: Defining statements uses defining keywords to define subroutines, dialog modules, functional modules, and methods. Defining statements ends with END keywords.
Some definitive keywords are;
1. FROM……END FROM
2. FUNCTION…..END FUNCTION
3. MODULE…..END MODULE
3) Control Keywords
Control statements uses control keywords to controls the flow of an ABAP program within a processing block based the specified conditions.
Some controls keywords are;
1. If---- endif.
7. Loop---endloop… ----->internal table concept
Debugging Controlling Key Word
Parameter: It is used to provide the single input values dynamically.
Debugging: It is process of identifying of internal process of program
o Break Point: A break point is an area in an ABAP program where the execution halts and turns on the debugging mode. The control is then transferred to ABAP debugger, which further controls the execution of the program. Break points are classified as
- Normal Breakpoint
- External breakpoint
2. Program logics.
4. Select, insert, modify etc.
5. Functional Module.
Types of Message
1. I------ Information
3. W---- Warning
4. E----- Error
Case when end case
1. Concatenate: It is one of the string operations. It is used to add the multiple string values into another string.
2. Split: It is one of the string operations. It is used to split the main value into multiple strings.
3. Condense: It is one string operations. It is used to remove the unwanted space in between the characters of the strings
4. Replace: It is one string operations. It is used to replace the strings.
5. Length: It is one string operations. It is used to find out the length of characters in a particular strings.
6. Translate: It is one string operations. It is used to convert upper case or lower case or lower case to upper case.
7. Substring: It is one string operations.
4) Call Keywords
Call statements uses call keywords to call processing blocks. The processing block can either be in the same program or in a different program.
Some call keywords are;
3. SET USER-COMMAND
5. LEAVE TO
5) Operational Keywords
Operational statements uses the operational keywords to process the data.
Some operational keywords are;
6) Database Keywords
Database statements uses the database keywords to access the tables in the central database system. There are two kinds of data statement in ABAP
A) Open SQL
B) Native SQL
Both type of statement use the below DML statement to access the database. Some database keywords are;
1) SELECT: Select is one of the data base keyword. It is used to fetch the data from the database table.
Select * from customer.
(*) --> All field info
db_t --> Customer
2) Insert: Insert is a database keyword. It s used to add or store the new records into database table.
3) Modify: Modify is one of data base keyword. It is used to modify the particular field value. It is one time activity.
4) Update: Update is one of the database keyword. It is used to change the particular field value frequently.
5) Delete: Delete is one of the database keyword. It is used to remove the unwanted data from the database table.
SAP MM/EWM Functional Consultant