Skip to Content
test
0 %
Create Your First ABAP Console Application
Details
// Explore More Tutorials

Create Your First ABAP Console Application

10/22/2018

Create an ABAP package and an ABAP class in the SAP Cloud Platform 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

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


Step 1: Open ABAP Development Tools in Eclipse
  1. Go to SAP on your Windows taskbar and click on the arrows.

    Open the ABAP Development Tools in Eclipse

  2. Select SAP Development Tools > ABAP in Eclipse - App Space - Oxygen

    Open the ABAP Development Tools in Eclipse

  3. Open the ABAP Perspective if not yet done.

    Open the ABAP Development Tools in Eclipse

Log on to answer question
Step 2: Update ADT plugin
  1. Navigate to menu path Help > check for updates.

    Update ADT

  2. If displayed in the wizard, then select ABAP Development Tools for SAP Net Weaver and move on with Next. If no ADT update is displayed then go ahead with step 3.

    Update ADT

  3. Press Next on the following wizard screen.

    Update ADT

  4. Accept the license agreements by selecting the appropriate entry on the wizard screen and press Finish to update your ADT installation.

    Update ADT
    ADT will be updated and restarted.

Log on to answer question
Step 3: Create ABAP Cloud project in ADT

Go to ADT and, select the menu path File > New > Other, filter and select ABAP Cloud Project from the wizard and then click Next.

Create an ABAP Cloud project in ADT
Log on to answer question
Step 4: Select service instance connection

In the next wizard screen, select SAP Cloud Platform Cloud Foundry Environment and click Next.

Select service instance connection
Log on to answer question
Step 5: Provide connection settings
  1. Maintain the SAP Cloud Platform Foundry connection information and click Next:

    • Region: <your_region>

    • Email: <your_email_address>

    • Password: <your_password>

    Setup connection settings

  2. Maintain the required Service Instance details by selecting the appropriate values from the drop-down lists and move on with Next.

    • Organization: <your_organization>

    • Space: <your_space>

    • Service Instance: <your_service_instance>

    Select service instance details

  3. Now provide your login credentials of the SAP Cloud Platform Identity Authentication Service (IAS) tenant to connect to the system and click Log On.

    Enter login credentials

  4. Connect to service instance by selecting Next.

    Connect to Service Instance

  5. At this stage you may add your favorite packages and click Finish to complete your setup.

    Add favorite packages

Log on to answer question
Step 6: Create ABAP package
  1. Right-click on the ZLocal package 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
    Create ABAP package
  3. Move on with Next.

    Select package properties

  4. Provide a description for the transport request and click Finish.

    Select transport request
    The ABAP package is now created.

Log on to answer question
Step 7: Create new ABAP class
  1. Add a new ABAP class to your package.

    Add new ABAP class

  2. Maintain the required information and click Next to move on:

    • Name: Z_Class_XXX
    • Description: My Class
    Add new ABAP class
  3. Provide a transport request and click Finish.

    Select transport request

  4. Your class is now created.

    Select transport request

Log on to answer question
Step 8: Implement Interface
  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!').

      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

Log on to answer question
Step 9: Execute ABAP application
  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

Log on to answer question
Step 10: Test yourself

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

×

Next Steps

Back to top