What is an ABAP Report? Theory + Your First Program
1. What is an ABAP report?
An ABAP report is a program that reads data from the SAP database, processes it, and shows the result to the user as a list. Think of it as a question you ask the system: “Show me all sales orders created this month.”
Reports are the most common thing a new ABAP developer builds. Almost every business team asks for them: finance, sales, warehouse, HR.
Report = input (selection screen) + data (SELECT) + processing (internal tables) + output (list or ALV).
Want structured, hands-on training as you follow this series? Explore our SAP ABAP Training course — it covers everything from this blog through ALV, enhancements, and real project work.
Classical vs. ALV reports
| Type | Output | Used for |
|---|---|---|
| Classical report | Plain text list using WRITE | Simple output, learning the basics |
| Interactive report | List with double-click drill-down | Summary then detail views |
| ALV report | Grid with sort, filter, export | Almost all real projects |
This series starts with classical reports and builds up to production-ready ALV.
2. The ABAP development environment
You can write ABAP in two places:
| Tool | What it is | Best for |
|---|---|---|
| SE38 (ABAP Editor) | Built into SAP GUI. Type SE38 in the command field. | Learning, quick edits |
| Eclipse ADT | ABAP Development Tools plugin for Eclipse | Modern development, CDS, RAP |
In this series, examples work in both. We will use SE38 because it is available in every SAP system.
Create a program in SE38
- Open SAP GUI and type
SE38in the command field. Press Enter. - Enter the program name, for example
ZHELLO_ABAP. Custom programs must start withZorY. - Click Create. Enter a title and choose type Executable program.
- Save as a local object (package
$TMP) while you practise. - Write your code, then press Ctrl+F3 to activate and F8 to run.
If your changes do not show up, you probably saved but did not activate. Always press Ctrl+F3.
3. Anatomy of a report program
Every report starts with the REPORT statement. After that you add code and output statements.
| Statement | What it does |
|---|---|
REPORT zname. | First line. Declares the program name. |
* at line start, or " mid-line | Comments. The system ignores them. |
WRITE 'text'. | Prints text to the output list. |
WRITE: / 'text'. | The / starts a new line first. |
NEW-LINE. | Moves to the next line. |
SKIP n. | Inserts n blank lines. |
ULINE. | Draws a horizontal line. |
ABAP uses . to end a statement. Forgetting it is the number one beginner error.
4. Your first program: Hello ABAP
Copy this into SE38, activate, and run it.
*&---------------------------------------------------------------------*
*& Report ZHELLO_ABAP
*& My first ABAP report
*&---------------------------------------------------------------------*
REPORT zhello_abap.
" Declare a variable
DATA lv_name TYPE string VALUE 'ABAP Learner'.
" Print a heading
WRITE: / 'Hello ABAP!'.
ULINE.
" Print using the variable
WRITE: / 'Welcome,', lv_name.
SKIP 1.
" Print system information
WRITE: / 'User :', sy-uname,
/ 'Date :', sy-datum,
/ 'Time :', sy-uzeit,
/ 'System ID :', sy-sysid.
What happens, line by line
REPORT zhello_abap.names the program.DATA lv_name TYPE string VALUE '...'.creates a text variable with a starting value.WRITE: / ...prints on a new line. The colon lets you chain several outputs.sy-uname,sy-datumandsy-uzeitare system fields filled automatically by SAP.
Expected output
Hello ABAP!
-----------------------------------
Welcome, ABAP Learner
User : YOUR_USER
Date : 31.10.2026
Time : 14:05:22
System ID : DEV
Your values will differ based on your login and system.
5. System fields you must know
System fields live in the structure SY (also written SYST). SAP fills them for you. You only read them.
| Field | Meaning |
|---|---|
sy-uname | Logged-in user name |
sy-datum | Current date |
sy-uzeit | Current time |
sy-sysid | System ID (DEV, QAS, PRD) |
sy-mandt | Client number |
sy-repid | Current program name |
sy-subrc | Return code of the last statement. 0 = success, anything else = problem. |
sy-tabix | Current row index of an internal table |
sy-dbcnt | Number of rows touched by the last database statement |
sy-lsind | Current list level (used in interactive reports) |
sy-subrc is the field you will check most often. After a SELECT or READ TABLE, always test whether it equals 0.
6. Try it yourself
- Change
lv_nameto your own name and run again. - Add
WRITE: / sy-repid.to show the program name. - Use
SKIP 3.and see the blank lines. - Add a second
ULINE.at the end. - Create a variable
lv_year TYPE i VALUE 2026.and print it.
7. Common mistakes
- Missing period. Every statement must end with
. - Not activating. Save is not enough. Press Ctrl+F3.
- Wrong program name. Custom programs must start with Z or Y.
- Quotes mismatch. Text uses single quotes:
'text'. Double quotes start a comment. - Forgetting the colon. Chained
WRITE:needs the colon after the keyword. - Ignoring sy-subrc. Later you will read data. Always check the return code.
8. Featured courses
Build Your SAP Career
Hand-picked courses to go deeper after this blog.
Up next: Blog 2
Selection Screens. Learn PARAMETERS and SELECT-OPTIONS so users can enter values, and build a calculator report.
WhatsApp us