ERPClimb logoERPClimb
ABAP Core
ABAP Developmentbeginner 7 min read

ABAP Core Part 1: Your First ABAP Program and the Development Tools

Lessons are open to try during our launch period. Some advanced content may move to Pro later. AI practice limits apply separately.

Key takeaway

Start ABAP the right way: what ABAP is, where programs run, the main program types, SE38/SE80 vs ADT, and your first executable program on the flight demo data — step by step.

In this lessonShow sections

Concept visual

ABAP · First programERPClimb.com

From ABAP source to a testable report

1

Create an executable program

Use the appropriate development environment for your ABAP system.

2

Declare data and write logic

Use explicit types and a clear processing path.

3

Syntax check, activate and run

Resolve errors, then execute with known test inputs.

4

Debug and verify output

Break at a relevant statement and inspect the resulting values.

ADT/Eclipse and SAP GUI tooling vary by ABAP platform release and project setup.

The situation: a real project scenario

A new team member created all his practice programs in $TMP and later built a real correction for a production issue there as well. When the fix had to go to QAS, it could not be transported, and the change had to be recreated in a proper package under time pressure.
The team now starts every trainee with a small ZTRAINING package, explains local vs transportable objects on day one, and uses ADT as the default editor so that ATC checks and unit tests are part of the daily flow.

Explanation

ABAP, short for Advanced Business Application Programming, is SAP's language for building business applications. It runs inside the ABAP application server, right alongside SAP's own code, with direct access to the database through ABAP SQL, as well as to authorizations, transactions, and the transport system. You'll use it to build reports, interfaces, enhancements, forms, services, and RAP applications.

This series covers ABAP Core in ten parts: this lesson on your first program and the development tools; Part 2 on DATA, TYPES, CONSTANTS, work areas, and internal tables; Part 3 on data types and literals; Part 4 on control flow and building output texts; Part 5 on selection screens; Part 6 on system fields; Part 7 on operators, calculations, and conversions; Part 8 on messages; Part 9 on exceptions with TRY/CATCH; and Part 10 on clean ABAP basics.

The running example throughout is SAP's flight demo data model — SCARR for airlines, SPFLI for connections, SFLIGHT for flights, and SBOOK for bookings — which you can fill once using report SAPBC_DATA_GENERATOR if it's currently empty.

You'll meet several kinds of program units along the way. An executable program, or report, is started with SE38 and F8 or through a transaction, and typically has its own selection screen — this is the classic report. A class, created as a global class in SE24 or ADT, is the modern home for most logic.

A function group containing function modules is the classic way to build reusable or remote-enabled logic, including BAPIs and RFCs. An include is simply a code fragment inserted into other programs. And CDS views, behavior definitions, and service definitions are the modern data and service objects covered separately in the RAP module.

On tooling, SE38, SE80, SE24, and SE37 in SAP GUI are the classic editors most ECC and S/4HANA projects still use day to day for reports, classes, and function modules. ADT — ABAP Development Tools in Eclipse — adds code completion, refactoring, and ABAP Unit, and is required for working with CDS views and RAP. SE11 is the data dictionary, where you define tables, data elements, and structures.

Every object you create belongs to a package, and, outside of $TMP, to a transport request as well. $TMP holds local objects that are never transported and exist purely for experimentation. Real work happens in a Z package, such as ZTRAINING, attached to a transport request, so the object can move through the landscape from DEV to QAS to PRD.

To create your first program: in SE38, enter ZFLIGHT_FIRST and choose Create, selecting "Executable program" as the type and a package such as ZTRAINING (or $TMP / Local Object, just for practice). Paste in the code example and activate it with Ctrl+F3 — inactive code never runs.

Run it with F8, enter an airline code such as LH on the selection screen, and execute. Then try changing the airline and notice how sy-subrc tells you whether any data was actually found. With this you should be able to create, activate, and run an ABAP program, and know exactly where it lives in terms of package and transport.

Code example

ABAP Code
REPORT zflight_first.* ===== Your first ABAP report on the flight demo model (SE38) ===== * ===== Step 1: selection screen - user input =====PARAMETERS p_carr TYPE s_carr_id DEFAULT 'LH'.      " airline code, e.g. LH, AA * ===== Step 2: data declarations =====DATA: gt_flights TYPE STANDARD TABLE OF sflight,     " internal table      gs_flight  TYPE sflight.                       " work area START-OF-SELECTION.* ===== Step 3: read data from the database =====  SELECT * FROM sflight    INTO TABLE gt_flights    UP TO 20 ROWS    WHERE carrid = p_carr. * ===== Step 4: check the result with sy-subrc (0 = found) =====  IF sy-subrc <> 0.    WRITE: / 'No flights found for airline', p_carr.    RETURN.  ENDIF.   SORT gt_flights BY fldate. * ===== Step 5: simple list output =====  WRITE: / 'Flights for airline', p_carr.  ULINE.  LOOP AT gt_flights INTO gs_flight.    WRITE: / gs_flight-connid,             gs_flight-fldate,             gs_flight-price CURRENCY gs_flight-currency,             gs_flight-currency,             gs_flight-seatsocc, '/', gs_flight-seatsmax.  ENDLOOP. * Tip: no data? Run report SAPBC_DATA_GENERATOR once to fill the demo tables.* 💡 Modern syntax (7.40+): LOOP AT gt_flights INTO DATA(ls_flight) declares the*    work area inline; SELECT ... INTO TABLE @gt_flights uses host variables with @.

Watch out

Common mistakes

  • Building real changes as local $TMP objects.
  • Forgetting to activate before running.
  • Ignoring sy-subrc after reading data.
  • Using only SE38 and missing ADT features (quick fixes, ATC, unit tests).
  • Hard-coding values instead of using selection screen parameters.

Do this

Best practices

  • Use ADT as the main development environment.
  • Create objects in a proper package with a transport request.
  • Follow naming conventions (Z/Y namespace, meaningful names).
  • Check sy-subrc after database reads.
  • Keep practice code separate from project code.

In the interview

Interview angle

Questions: "What is ABAP and where does it run?", "What program types exist?", "What is the difference between $TMP and a transportable package?"
Strong answer: ABAP runs on the SAP application server with direct access to the database, authorizations and transport system; program types include executable programs, classes, function groups, includes and CDS/RAP objects; ADT is the recommended IDE; $TMP objects are local and not transportable, while real development uses Z packages and transport requests moving DEV → QAS → PRD.

Practice this lesson

Quick check

0 of 3 questions attempted

Question 1 of 3

Where should a new ABAP object that must go to production be created?

Practise this in an interview

Answer in your own words and get instant feedback, the way an interviewer would judge it.

1How do you decide between a report, a Fiori app or a background job?

2You need to build a report that reads flight bookings, applies business rules, and outputs an ALV. Describe the modularisation you would choose and why.

Try a related Code Lab

This published exercise covers the same SAP topic. Apply the ideas in a hands-on scenario, then return to review your answers.

Open: Missing SY-SUBRC check after READ TABLE →

See it in code

Each example starts from a requirement, shows the design, then the code step by step with a plain-language explanation of every part.

Was this lesson helpful?

Keep exploring

Referenced SAP objects

Reviewed reference pages for the objects this page mentions.

Check before use: lesson examples are educational, not a guarantee of correctness for your SAP edition or release. Sample code has not been executed on your SAP system. Confirm API availability, syntax, authorizations and business impact in an approved development or test environment.