Skip to Content
Previous

Create Your First ABAP Console Application

By Merve Yalcin

Create an ABAP class and ABAP package in Eclipse to run your application console in SAP Cloud Platform ABAP environment.

Details

You will learn

  • How to create an ABAP class in Eclipse
  • How to create an ABAP package
  • How to execute an application

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


Step 1: Open ABAP cloud project

Open Eclipse, select File > New > Other > ABAP Cloud Project, then click Next.

Open ABAP Cloud Project
Please log in to access this content.
Step 2: Select service instance connection

Select SAP Cloud Platform Cloud Foundry Environment, and click Next.

Select service instance connection
Please log in to access this content.
Step 3: Setup connection settings

Connect to System and add following information:

  • Region: Europe
  • Email: <your_email_address>
  • Password: <your_password>

and click Next.

Setup connection settings
Please log in to access this content.
Step 4: Select service instance details

Drill down and select the following information:

  • Organization: <your_organization>
  • Space: <your_space>
  • Service Instance: <your_service_instance>
    and move on with Next.
Select service instance details
Please log in to access this content.
Step 5: Enter login credentials

Connect to your system by using your e-mail address and your Windows password.

Enter login credentials
Please log in to access this content.
Step 6: Connect to service instance

Connect to service instance by selecting Next.
Connect to Service Instance

Please log in to access this content.
Step 7: Add favorite packages

Add favorite packages and click Finish to complete your setup.

Add favorite packages
Please log in to access this content.
Step 8: Add ABAP package

Add your own ABAP package to local package.

Add ABAP package
Please log in to access this content.
Step 9: Create ABAP package

Name following fields:

  • Name
  • Description
    Move on with Next.
Create ABAP package
Please log in to access this content.
Step 10: Select package properties

Move on with Next.

Select package properties
Please log in to access this content.
Step 11: Select transport request
  1. Add a description for the request.
  2. Click Finish.
    Select transport request
    The ABAP package is now created.
Please log in to access this content.
Step 12: Add new ABAP class

Add a new ABAP class to your package.

Add new ABAP class
Please log in to access this content.
Step 13: Create new ABAP class

Create an ABAP class by adding the following information:

Add new ABAP class

Click Next.

Please log in to access this content.
Step 14: Select transport request

Click Finish to create your transport request.

Select transport request
Please log in to access this content.
Step 15: Add method

Add the following method to your ABAP class.

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.

Save and activate your changes.

Please log in to access this content.
Step 16: 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

Please log in to access this content.
Step 17: Test yourself

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

×

Updated 09/14/2018

Time to Complete

5 Min.

Beginner

Prerequisites

  • SAP Cloud Platform ABAP environment user
  • latest Eclipse Oxygen (4.7)
  • latest ADT
Next
Back to top