Est. 1983 Intermediate

ABAP

SAP's proprietary programming language for building enterprise business applications - the backbone of global financial systems, supply chains, and HR platforms running on SAP.

Created by SAP SE (Klaus Tschira, Gerd Rodé)

Paradigm Multi-paradigm: Procedural, Object-Oriented (ABAP Objects)
Typing Static, Strong
First Appeared 1983
Latest Version ABAP Cloud (2024)

ABAP (Advanced Business Application Programming) is SAP’s proprietary programming language, powering the business software that runs the world’s largest corporations. Originally designed for report generation on mainframes, it evolved into a full-fledged enterprise development platform that processes trillions of dollars in transactions annually.

History & Origins

ABAP’s story is inseparable from SAP itself - the German software giant that became the world’s leading enterprise software company.

The SAP Beginnings (1972)

SAP (Systemanalyse Programmentwicklung, later Systeme, Anwendungen, Produkte) was founded in 1972 by five former IBM engineers in Mannheim, Germany: Dietmar Hopp, Claus Wellenreuther, Hasso Plattner, Klaus Tschira, and Hans-Werner Hector.

Their vision was revolutionary: real-time data processing for business applications, rather than overnight batch processing that was standard at the time.

Birth of ABAP (1983)

In 1983, Klaus Tschira conceived the idea for ABAP, and Gerd Rodé created it as a fourth-generation language (4GL) for SAP R/2. The original name was “Allgemeiner Berichts-Aufbereitungs-Prozessor” (German for “General Report Preparation Processor”).

ABAP was designed specifically for business applications:

  • Built-in database access (Open SQL)
  • Integrated report generation
  • Multi-language support for international business
  • Currency and unit handling

The R/3 Revolution (1992)

When SAP launched R/3 - their client-server architecture system - ABAP became the primary development language. This was a pivotal moment that established ABAP as an enterprise standard.

R/3 features that drove ABAP adoption:

  • Three-tier architecture (presentation, application, database)
  • Platform independence
  • Integration across business functions
  • Customization through ABAP development

Object-Oriented Evolution (1999)

SAP introduced ABAP Objects with R/3 release 4.6, adding:

  • Classes and interfaces
  • Inheritance and polymorphism
  • Exception handling
  • Events and event handlers

This brought ABAP into the modern programming era while maintaining backward compatibility with procedural code.

Modern ABAP (2010s-Present)

Recent versions have modernized the language significantly:

ABAP 7.40+ Features:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
" Inline declarations
DATA(lv_name) = 'World'.

" Constructor operators
DATA(lt_numbers) = VALUE #( ( 1 ) ( 2 ) ( 3 ) ).

" Table expressions
DATA(lv_first) = lt_numbers[ 1 ].

" String templates
DATA(lv_greeting) = |Hello, { lv_name }!|.

ABAP Cloud: The latest evolution promotes clean development:

  • RESTful Application Programming (RAP)
  • Cloud-native APIs
  • Modern development tools (Eclipse-based ADT)
  • Strict code quality rules

What Makes ABAP Different

1. Business-First Design

ABAP was built for business applications from day one:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
" Built-in currency handling
DATA: lv_amount TYPE p DECIMALS 2,
      lv_currency TYPE waers VALUE 'USD'.

" Automatic rounding and conversion
lv_amount = '1234.567'.  " Automatically rounds to 1234.57

" Built-in date arithmetic
DATA: lv_today TYPE d,
      lv_due_date TYPE d.
lv_today = sy-datum.
lv_due_date = lv_today + 30.  " 30 days from now

2. Integrated Database Access (Open SQL)

ABAP includes SQL-like syntax for database operations:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
" Select with automatic type handling
SELECT * FROM customers
  INTO TABLE @DATA(lt_customers)
  WHERE country = 'US'.

" Aggregate functions
SELECT COUNT(*) AS count,
       SUM( amount ) AS total
  FROM orders
  INTO @DATA(ls_summary)
  WHERE status = 'COMPLETED'.

3. Internal Tables

ABAP’s powerful in-memory table handling:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
" Declare a table type
TYPES: BEGIN OF ty_employee,
         id TYPE i,
         name TYPE string,
         department TYPE string,
       END OF ty_employee.

DATA: lt_employees TYPE TABLE OF ty_employee.

" Add entries
APPEND VALUE #( id = 1 name = 'Alice' department = 'IT' ) TO lt_employees.
APPEND VALUE #( id = 2 name = 'Bob' department = 'HR' ) TO lt_employees.

" Loop with work area
LOOP AT lt_employees INTO DATA(ls_emp).
  WRITE: / ls_emp-name, ls_emp-department.
ENDLOOP.

" Read single entry
READ TABLE lt_employees INTO DATA(ls_found) WITH KEY name = 'Alice'.

4. Multi-Language Support

Built-in internationalization:

1
2
3
4
5
6
7
8
" Text symbols - translated per language
WRITE: TEXT-001.  " 'Hello' in English, 'Hallo' in German

" Message class
MESSAGE i001(zmessages).  " Information message from message class

" Language-dependent date formatting
WRITE: sy-datum.  " Formatted according to user's language

5. Authorization Framework

Enterprise-grade security built in:

1
2
3
4
5
6
7
8
" Check user authorization
AUTHORITY-CHECK OBJECT 'S_CARRID'
  ID 'CARRID' FIELD lv_carrier
  ID 'ACTVT' FIELD '03'.  " Display activity

IF sy-subrc <> 0.
  MESSAGE 'Not authorized' TYPE 'E'.
ENDIF.

ABAP Program Types

Reports (Type 1)

Classical programs with selection screens:

1
2
3
4
5
6
REPORT zhello.

PARAMETERS: p_name TYPE string DEFAULT 'World'.

START-OF-SELECTION.
  WRITE: / |Hello, { p_name }!|.

Function Modules

Reusable units of code:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
FUNCTION z_calculate_tax.
*"----------------------------------------------------------------------
*"  IMPORTING
*"     VALUE(IV_AMOUNT) TYPE  P
*"     VALUE(IV_RATE) TYPE  P DEFAULT '0.20'
*"  EXPORTING
*"     VALUE(EV_TAX) TYPE  P
*"----------------------------------------------------------------------
  ev_tax = iv_amount * iv_rate.
ENDFUNCTION.

Classes (ABAP Objects)

Modern object-oriented programming:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
CLASS zcl_greeter DEFINITION.
  PUBLIC SECTION.
    METHODS: constructor IMPORTING iv_name TYPE string,
             greet RETURNING VALUE(rv_greeting) TYPE string.
  PRIVATE SECTION.
    DATA: mv_name TYPE string.
ENDCLASS.

CLASS zcl_greeter IMPLEMENTATION.
  METHOD constructor.
    mv_name = iv_name.
  ENDMETHOD.

  METHOD greet.
    rv_greeting = |Hello, { mv_name }!|.
  ENDMETHOD.
ENDCLASS.

" Usage
DATA(lo_greeter) = NEW zcl_greeter( 'World' ).
DATA(lv_msg) = lo_greeter->greet( ).

Web Dynpro / Fiori

Modern UI development:

1
2
3
4
5
6
7
8
9
" CDS View for Fiori app
@AbapCatalog.sqlViewName: 'ZORDERS_V'
@OData.publish: true
define view Z_ORDERS as select from orders {
  key order_id,
  customer,
  amount,
  status
}

Development Environment

SAP GUI & SE80

Traditional development in SAP GUI:

  • Transaction SE80 (Object Navigator)
  • SE38 for programs
  • SE24 for classes
  • SE37 for function modules

Eclipse-based ADT

Modern development environment:

  • ABAP Development Tools (ADT)
  • Git integration (abapGit)
  • Code completion
  • Refactoring tools

abapGit

Open-source Git client for ABAP:

  • Version control for ABAP code
  • GitHub/GitLab integration
  • Collaborative development

The Open-ABAP Project

Running ABAP outside SAP systems is now possible thanks to the open-abap project:

  • Transpiler: Converts ABAP to JavaScript
  • Runtime: Executes transpiled code on Node.js
  • abaplint: Static analysis and linting

This enables:

  • Learning ABAP without SAP access
  • Unit testing outside SAP systems
  • Running ABAP on platforms like Exercism

ABAP vs Other Languages

FeatureABAPJavaCOBOLPL/SQL
Primary UseSAP Business AppsGeneral EnterpriseMainframe BusinessOracle Database
Database AccessOpen SQL (built-in)JDBC/JPAEmbedded SQLNative
Business TypesBuilt-in (currency, date)LibrariesBuilt-inSome
OOP SupportFull (ABAP Objects)FullLimitedLimited
IDESAP GUI/ADTManyVariesSQL Developer
Open SourceabapGit, open-abapYesGnuCOBOLNo

Common Patterns

ALV (ABAP List Viewer)

Standard grid display:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
" Simple ALV display
DATA: lt_flights TYPE TABLE OF sflight.

SELECT * FROM sflight INTO TABLE lt_flights.

cl_salv_table=>factory(
  IMPORTING r_salv_table = DATA(lo_alv)
  CHANGING t_table = lt_flights ).

lo_alv->display( ).

BADI (Business Add-In)

Enhancement framework:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
" Implementing a BADI
CLASS zcl_my_badi DEFINITION.
  PUBLIC SECTION.
    INTERFACES: if_ex_some_badi.
ENDCLASS.

CLASS zcl_my_badi IMPLEMENTATION.
  METHOD if_ex_some_badi~some_method.
    " Custom logic here
  ENDMETHOD.
ENDCLASS.

RFC (Remote Function Call)

Cross-system communication:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
" Call function in remote system
CALL FUNCTION 'Z_GET_DATA'
  DESTINATION 'RFC_DESTINATION'
  EXPORTING
    iv_param = lv_input
  IMPORTING
    ev_result = lv_output
  EXCEPTIONS
    system_failure = 1
    communication_failure = 2.

Why ABAP Matters

Despite being proprietary and often criticized for verbosity, ABAP remains critical because:

  1. SAP Dominance: SAP runs critical processes at most Fortune 500 companies
  2. Massive Codebase: Billions of lines of ABAP power global business
  3. Integration: Deep integration with SAP’s business processes
  4. Stability: Backward compatibility over decades
  5. Career Opportunities: Strong demand for ABAP developers

Getting Started

While traditionally requiring SAP system access, you can now:

  1. Use open-abap: Run ABAP on Node.js (covered in Hello World tutorial)
  2. SAP Learning Hub: Free trial systems from SAP
  3. ABAP Platform Trial: Docker-based SAP system for learning
  4. Exercism: ABAP track using open-abap transpiler

Continue to the Hello World tutorial to write your first ABAP program using the open-abap transpiler.

Key Takeaways

  1. ABAP is 40+ years old and still actively developed
  2. Business-focused design with built-in currency, date, and authorization
  3. Open SQL provides integrated database access
  4. Internal tables offer powerful in-memory data handling
  5. ABAP Objects brings modern OOP to enterprise development
  6. Open-abap enables learning without SAP infrastructure
  7. Critical for SAP ecosystems running global enterprises

Timeline

1983
ABAP created at SAP as a report preparation language for SAP R/2 mainframe system
1992
SAP R/3 released with ABAP as the primary development language
1999
ABAP Objects introduced with R/3 release 4.6, adding object-oriented programming
2004
SAP NetWeaver platform launched with ABAP and Java as dual programming options
2006
ABAP 7.0 released with switch framework and enhanced exception handling
2012
ABAP 7.40 adds inline declarations, table expressions, and constructor operators
2015
SAP S/4HANA launched, modernizing ABAP for in-memory computing with HANA database
2020
Open-abap transpiler enables running ABAP code on Node.js without SAP infrastructure
2023
ABAP celebrates 40th anniversary, remains critical for SAP S/4HANA development
2024
ABAP Cloud model promotes clean core development and extensibility

Notable Uses & Legacy

SAP ERP/S/4HANA

Core business processes for finance, supply chain, manufacturing, and HR at 90% of Fortune 500 companies.

SAP Business Suite

Integrated applications including CRM, SRM, PLM running on ABAP application servers worldwide.

Financial Accounting

Powers general ledger, accounts payable/receivable, and asset accounting for global enterprises.

Materials Management

Inventory control, procurement, and warehouse management systems across industries.

Human Capital Management

Payroll, personnel administration, and organizational management for millions of employees globally.

Custom ABAP Development

Millions of lines of custom business logic extend SAP systems at enterprises worldwide.

Language Influence

Influenced By

COBOL SQL 4GL Languages

Influenced

None widely known

Running Today

Run examples using the official Docker image:

docker pull node:20-alpine

Example usage:

docker run --rm -v $(pwd):/app -w /app node:20-alpine sh -c 'npm install --silent @abaplint/transpiler-cli 2>/dev/null && npx abap_transpile --src hello.abap --output . && node output.cjs'

Topics Covered

Last updated: