Skip to Content

Create Your First ABAP Console Application

Create an ABAP package and an ABAP class in the SAP BTP, ABAP Environment with the ABAP Development Tools (ADT) in Eclipse.
You will learn
  • How to create an ABAP cloud project in ADT
  • How to create an ABAP package
  • How to create an ABAP class
  • How to execute the application console
mervey45Merve TemelMay 21, 2025
Created by
julieplummer20
March 9, 2023
Contributors
julieplummer20

Prerequisites

For ABAP license:
- You have set up your ABAP environment as described in Getting Started with a Customer Account: Workflow in the ABAP Environment
- You have a user in the ABAP Environment Connect to the ABAP System
- You have downloaded the ABAP Development Tools (ADT). SAP recommends the latest version of ADT, available from ABAP Development Tools
For ABAP Trial:
- You need an SAP BTP, ABAP environment trial user.
- You have downloaded the ABAP Development Tools (ADT). SAP recommends the latest version of ADT, available from ABAP Development Tools

In this tutorial, wherever XXX appears, use a number (e.g. 000) or your initials.

For more information, see:
- SAP Help Portal: What is SAP BTP

  • Step 1

    Open the ADT and change to the ABAP perspective, using the menu.

    ABAP menu

    And select ABAP and choose Open.

    perspective

    Or select the icon.

    ADT ABAP icon
  • Step 2
    1. In the ADT, select the menu path File > New > Other.

      Create an ABAP Cloud project in ADT
    2. Search for ABAP Cloud Project, select it and choose Next.

      Select ABAP Cloud Project
    3. Paste the URL of your ABAP instance in Service URL and choose Next.

      step2c-enter-URL
    4. choose Open Logon Page in Browser.

      Create ABAP cloud project
    5. Now you’ve been authenticated automatically. Provide your credentials if requested. The credentials are the same you used to create your trial account on SAP BTP.

    6. Go back to ADT and choose Finish.

      Create ABAP cloud project

      Choose Finish.

  • Step 3
    1. Right-click on the package ZLOCAL and select New > ABAP Package from the context menu.

      Add ABAP package
    2. Provide the required information and move on with Next.

      • Name: ZPACKAGE_XXX
      • Description: My Package XXX
      • Check Add to favorite packages.
      Create ABAP package
      Choose Next >.
    3. Create a new request and choose Finish.

      Select transport request

      The ABAP package is now created.

  • Step 4
    1. Add a new ABAP class to your package.

      Add new ABAP class
    2. Maintain the required information and choose Next twice:

      • Name: Z_CLASS_XXX
      • Description: My class XXX
      Add new ABAP class
    3. choose Finish.

      Select transport request
    4. Your class is now created.

      Select transport request
  • Step 5
    1. In the class definition, specify the interface IF_OO_ADT_CLASSRUN in the public section as shown on the screenshot. Now go to the class implementation and provide the implementation of the method IF_OO_ADT_CLASSRUN~MAIN. As shown on the screenshot, it should output the text Hello World! using the code line below
      out->write('Hello World!').

      ABAP
      Copy
      CLASS z_class_xxx DEFINITION
        PUBLIC
        FINAL
        CREATE PUBLIC .
      
        PUBLIC SECTION.
          INTERFACES if_oo_adt_classrun.
        PROTECTED SECTION.
        PRIVATE SECTION.
      ENDCLASS.
      
      CLASS z_class_xxx IMPLEMENTATION.
        METHOD if_oo_adt_classrun~main.
          out->write( 'Hello world!' ).
        ENDMETHOD.
      ENDCLASS.
      
    2. Save and activate your changes.

      Implement an Interface
  • Step 6
    1. Right-click your class and select Run As > ABAP Application (Console) or select your class and press F9.

      Execute ABAP application
    2. Check your result.

      Execute ABAP application
  • Step 7

    Write only the write statement with following information: Hello SAP Cloud Platform ABAP Environment!

Back to top