SAP ABAP Keywords

SAP ABAP keywords are predefined words that identify the type of ABAP statement being written. In most ABAP programs, each executable or declarative statement starts with a keyword such as DATA, SELECT, IF, LOOP, CALL FUNCTION, or WRITE. These keywords tell the ABAP runtime whether the statement declares data, controls program flow, reads database records, calls reusable logic, or displays output.

ABAP keywords are not case-sensitive. You can write predefined ABAP words in uppercase, lowercase, or mixed case. However, most ABAP tutorials and many project coding standards use uppercase for keywords because it makes the program easier to read.

WRITE 'Hello WORLD'

wRITE 'Hello World'

Both statements use the same WRITE keyword. In a real ABAP program, remember to end statements with a period where required by ABAP syntax.

How SAP ABAP keywords form ABAP statements

An ABAP statement is built around a keyword and usually ends with a period. Some statements are simple, while others open a block that must be closed with a matching end keyword. For example, IF is closed by ENDIF, LOOP is closed by ENDLOOP, and FORM is closed by ENDFORM.

</>
Copy
DATA lv_message TYPE string.

lv_message = 'Hello ABAP'.

IF lv_message IS NOT INITIAL.
  WRITE lv_message.
ENDIF.

In this short example, DATA declares a variable, IF checks a condition, WRITE displays output, and ENDIF closes the conditional block.

ABAP keywords can be grouped according to their purpose. The important types of keywords are:

  1. Calling Keywords
  2. Controlling Keywords
  3. Declarative Keywords
  4. Definition Keywords
  5. Database Keywords
  6. Event Keywords
  7. Operational Keywords

SAP ABAP calling keywords for reusable program logic

Calling keywords are used to call reusable processing blocks that are already defined in the same program, another program, a function group, or another ABAP object. They help avoid repeating the same logic in many places.

PERFROM to CALL FORM - ENDFORM
CALL FUNCTION to CALL FUNCTION - ENDFUNCTION
MODULE to CALL MODULE - ENDMODULE

In actual ABAP syntax, the common form routine call is written as PERFORM. A function module is called using CALL FUNCTION, and dialog module processing is commonly connected with MODULE in screen programming.

Calling keywordPurpose in ABAPTypical matching block
PERFORMCalls a subroutine in procedural ABAP.FORMENDFORM
CALL FUNCTIONCalls a function module.FUNCTIONENDFUNCTION
CALL METHODCalls a method of a class or object.METHODS / METHOD
SUBMITStarts another executable ABAP program.Executable report program

SAP ABAP controlling keywords for program flow

Controlling keywords are used to change the normal top-to-bottom execution of an ABAP program. They are used for decisions, loops, exits, and conditional processing.

IF, ELSE, ENDIF
DO-ENDDO, WHILE-ENDWHILE
Controlling keywordUseClosing keyword, if any
IF, ELSEIF, ELSEExecutes statements based on conditions.ENDIF
CASE, WHENSelects one branch from multiple possible values.ENDCASE
DORuns a statement block repeatedly.ENDDO
WHILERepeats statements while a condition is true.ENDWHILE
LOOPProcesses rows of an internal table.ENDLOOP
EXIT, CONTINUE, CHECKChanges loop or block execution.Depends on the surrounding block
</>
Copy
IF lv_amount GT 1000.
  WRITE 'High amount'.
ELSE.
  WRITE 'Normal amount'.
ENDIF.

SAP ABAP declarative keywords for variables and data types

Declarative keywords are used to define the data that an ABAP program works with. They can declare variables, constants, internal tables, structures, field symbols, and custom types.

TYPES, DATA, TABLES, CONSTANTS.
Declarative keywordPurposeSimple example
DATADeclares variables and data objects.DATA lv_count TYPE i.
TYPESDefines a reusable data type.TYPES ty_name TYPE c LENGTH 40.
CONSTANTSDeclares a value that should not change.CONSTANTS lc_tax TYPE p DECIMALS 2 VALUE '18.00'.
FIELD-SYMBOLSDeclares a symbolic reference to a data object.FIELD-SYMBOLS <fs_row> TYPE any.
PARAMETERSDeclares a single input field on the report selection screen.PARAMETERS p_name TYPE string.
SELECT-OPTIONSDeclares range-based input on the selection screen.SELECT-OPTIONS s_date FOR sy-datum.

TABLES appears in many older ABAP programs. In newer code, explicit declarations with DATA, structured types, and internal tables are generally clearer and easier to maintain.

SAP ABAP definition keywords for reusable blocks

Definition keywords create reusable processing blocks. The calling keyword starts the reuse, while the definition keyword declares what should run when the block is called.

FORM - ENDFORM
FUNCTION - ENDFUNCTION
MODULE - ENDMODULE
Definition keywordWhat it definesWhere it is commonly seen
FORMENDFORMA subroutine.Classical procedural ABAP reports.
FUNCTIONENDFUNCTIONA function module.Function groups and older reusable APIs.
MODULEENDMODULEA dialog module.Dynpro or module pool programming.
CLASSENDCLASSAn ABAP class.Object-oriented ABAP.
METHODENDMETHODA method implementation.Object-oriented ABAP classes.
</>
Copy
FORM display_message.
  WRITE 'Message from subroutine'.
ENDFORM.

PERFORM display_message.

SAP ABAP database keywords for Open SQL operations

Database keywords are used to read and change data in database tables. In ABAP, database access is commonly written using Open SQL statements such as SELECT, INSERT, UPDATE, MODIFY, and DELETE. The exact syntax depends on the ABAP release and the data object being used.

SELECT - To select data
INSERT - To insert data
UPDATE - To change data
DELETE - To delete data
Database keywordPurpose in ABAPBasic meaning
SELECTReads data from database tables or views.Fetch records.
INSERTAdds new database records.Create records.
UPDATEChanges existing database records.Update records.
MODIFYInserts or updates depending on the target and key.Upsert-like behavior in many ABAP contexts.
DELETEDeletes database records.Remove records.
COMMIT WORKConfirms database changes in a logical unit of work.Save changes.
ROLLBACK WORKReverses pending database changes in a logical unit of work.Undo changes.
</>
Copy
SELECT carrid, connid
  FROM spfli
  INTO TABLE @DATA(lt_connections)
  UP TO 10 ROWS.

The example above shows a compact Open SQL read. The @DATA(...) part uses inline declaration, which is common in newer ABAP code. For production database updates, always follow your project rules for authorization checks, locking, error handling, and transaction control.

SAP ABAP event keywords in report programs

Event keywords define event blocks that ABAP executes at specific stages of a report program or list processing. These keywords are common in classical report programming.

TOP-OF-PAGE : Used to print the same heading on top of every page
END-OF-PAGE : Used to print the same footer on every page of output list.
Event keywordWhen it is used
INITIALIZATIONRuns before the selection screen is displayed, often to set default values.
AT SELECTION-SCREENHandles validation and user actions on the selection screen.
START-OF-SELECTIONMain processing block in many executable reports.
END-OF-SELECTIONRuns after the main selection processing is completed.
TOP-OF-PAGEWrites page header content in list output.
END-OF-PAGEWrites page footer content in list output.

SAP ABAP operational keywords for data processing

Operational keywords perform actions on data, such as assigning values, calculating values, moving data between variables, appending rows to internal tables, or displaying output.

WRITE
MOVE
ADD
Operational keywordPurposeModern note
WRITEWrites output to a classical list.Useful for simple reports and examples.
MOVEMoves a value from one data object to another.Direct assignment with = is often clearer.
ADDAdds numeric values.Arithmetic expressions are usually easier to read.
APPENDAdds a row to an internal table.Common in internal table processing.
READ TABLEReads a row from an internal table.Table expressions may be used in newer ABAP where suitable.
CLEARResets a variable or data object to its initial value.Still commonly used.

Modern SAP ABAP keyword examples: DATA, NEW, VALUE, and inline declarations

Many older ABAP tutorials focus only on classical keywords such as WRITE, FORM, and PERFORM. Modern ABAP also uses expression-oriented syntax. Keywords and operators such as DATA, VALUE, NEW, COND, and SWITCH are often seen in newer ABAP code, especially in object-oriented and SAP S/4HANA-style development.

</>
Copy
DATA(lv_name) = 'SAP ABAP'.

DATA lt_numbers TYPE TABLE OF i.
lt_numbers = VALUE #( ( 10 ) ( 20 ) ( 30 ) ).

The NEW operator is used to create objects or anonymous data objects in ABAP constructor expressions. The availability and exact syntax of newer expressions depend on the ABAP platform release, so refer to the official SAP ABAP Keyword Documentation for release-specific details.

SAP ABAP keyword categories at a glance

ABAP keyword categoryExamplesMain purpose
Calling keywordsPERFORM, CALL FUNCTION, CALL METHODCall reusable logic.
Controlling keywordsIF, CASE, LOOP, WHILEControl execution flow.
Declarative keywordsDATA, TYPES, CONSTANTSDeclare data objects and types.
Definition keywordsFORM, FUNCTION, CLASS, METHODDefine reusable blocks or objects.
Database keywordsSELECT, INSERT, UPDATE, DELETERead or change database data.
Event keywordsSTART-OF-SELECTION, TOP-OF-PAGEHandle report events.
Operational keywordsWRITE, MOVE, ADD, APPENDProcess data and output.

Common mistakes while learning SAP ABAP keywords

  • Forgetting the final period: many ABAP statements must end with a period. Missing it is a common beginner syntax error.
  • Misspelling ABAP keywords: for example, use PERFORM, not PERFROM, when calling a form routine.
  • Mixing block endings: close IF with ENDIF, LOOP with ENDLOOP, and CASE with ENDCASE.
  • Using old keywords without context: keywords such as TABLES, FORM, and MOVE exist in ABAP, but newer programs may prefer clearer modern alternatives.
  • Changing database data without safeguards: database keywords such as UPDATE and DELETE should be used only with proper conditions, authorization checks, and transaction handling.

SAP ABAP keywords FAQ

What are SAP ABAP keywords?

SAP ABAP keywords are predefined words used to build ABAP statements. They describe what the statement does, such as declaring data with DATA, checking a condition with IF, reading database records with SELECT, or displaying output with WRITE.

Are ABAP keywords case-sensitive?

No. ABAP keywords are not case-sensitive. WRITE, write, and wRITE are treated as the same keyword. Uppercase is commonly used for readability.

Which ABAP keywords are important for beginners?

Beginners should first learn DATA, TYPES, IF, CASE, LOOP, SELECT, WRITE, PERFORM, and CALL FUNCTION. These keywords cover basic declarations, conditions, loops, database access, output, and reusable logic.

What is the difference between ABAP calling keywords and definition keywords?

Calling keywords execute reusable logic, while definition keywords define that reusable logic. For example, PERFORM calls a subroutine, while FORM and ENDFORM define the subroutine.

Where can I check the official list of ABAP keywords?

The official source is SAP ABAP Keyword Documentation. It is the best reference when you need exact syntax, release-specific behavior, and detailed examples for a keyword.

QA checklist for this SAP ABAP keywords tutorial

  • Verify that each ABAP keyword category includes relevant examples and a clear purpose.
  • Check that ABAP block keywords are paired correctly, such as IF with ENDIF and LOOP with ENDLOOP.
  • Confirm that beginner examples show ABAP statements ending with periods where required.
  • Review old keywords such as TABLES, FORM, and MOVE with enough context so readers do not treat them as the only modern approach.
  • Use SAP ABAP Keyword Documentation as the reference when validating syntax for a specific ABAP platform release.