You are on page 1of 8

This article appears here with permission from the publisher of SAPinsider, WIS Publishing.

Take Your ABAP


Skills to the Cloud
Develop New Cloud Applications in ABAP
with SAP Cloud Platform ABAP Environment
At SAP TechEd in the fall of 2017, Björn Goerke, SAP’s Chief Technology Officer,
announced that ABAP would become available in SAP Cloud Platform in 2018, and
as of September 2018,1 the new ABAP development and runtime environment — SAP
Cloud Platform ABAP environment — is here. SAP Cloud Platform ABAP environment
is a completely new environment for SAP Cloud Platform, comparable to SAP Cloud
Platform for the Neo, Cloud Foundry, and Kubernetes environments.
Anyone familiar with ABAP knows that it is not just a programming language with a
Karl Kessler compiler and runtime — it is an integrated environment based on a primary database
(karl.kessler@sap.com) that contains the ABAP repository and all related ABAP artifacts, such as ABAP classes
joined SAP SE in 1992. and the data definitions based on the core data services (CDS) data modeling infrastruc-
He is the Vice President
ture. SAP Cloud Platform ABAP environment not only brings this architectural blue-
of Product Management
ABAP Platform — which print — which is currently the foundation of more than 100,000 productive on-premise
includes SAP NetWeaver installations — to the cloud, it also enables you to bring your existing ABAP develop-
Application Server, the
ment expertise and on-premise assets with you, smoothing the transition to the cloud.
ABAP Workbench, the
Eclipse-based ABAP Moving your ABAP development and execution environment to SAP Cloud
development tools, and Platform allows you to immediately benefit from the latest features of ABAP and SAP
SAP Cloud Platform HANA, as well as the innovations available in all existing SAP Cloud Platform ser-
ABAP environment —
and is responsible for all vices, such as SAP Leonardo with its machine learning, blockchain, and Internet of
rollout activities. Things technologies, which enable new scenarios that are not currently possible in the
on-premise world. It also allows you to delegate all infrastructure, lifecycle manage-
ment, and system operations tasks to the development and operations teams at SAP
and enables you to scale with your business needs rather than making large upfront
investments in hardware and services. In addition, you can take advantage of innova-
tions much faster, since updates are delivered quarterly rather than years apart.
This article prepares SAP customers and partners for this new world by explaining
the basic architecture and mechanics of SAP Cloud Platform ABAP environment and,
through practical examples, shows you how to use this new environment for ABAP

1
See “ABAP and the Cloud” in the October-December 2017 issue of SAPinsider (SAPinsiderOnline.com).

SAPinsiderOnline.com | Issue 3 • 2018


development. It walks through how to set up the and OData. In the initial version of SAP Cloud
development environment, how to use the develop- Platform ABAP environment, these applications
ment tools to create a back-end service, and how to can connect to an SAP S/4HANA Cloud back end,
enable the newly created back-end service for con- and in planned future versions, access to on-prem-
sumption by an SAP Fiori application. ise back ends will be enabled through the Cloud
Connector component for SAP Cloud Platform.
The Architecture of SAP Cloud Platform It is important to note that with SAP Cloud Plat-
ABAP Environment form ABAP environment, SAP Fiori is the only sup-
Figure 1 provides an architectural overview of ported user interface (UI) technology — SAP GUI
SAP Cloud Platform ABAP environment. Adminis- and Web GUI are strictly prohibited, since screen
trators (and developers with the appropriate privi- processing is not ideal for the cloud. In addition,
leges) can launch SAP Cloud Platform cockpit via unlike in the on-premise ABAP stack, the ABAP
their SAP Cloud Platform account and create a new development tools do not call any embedded SAP
ABAP instance — that is, a complete ABAP stack GUI tools in SAP Cloud Platform ABAP environ-
with an underlying SAP HANA database — in the ment. All tool access in SAP Cloud Platform ABAP
cloud. The cloud-based ABAP system is then up and environment is done with the native Eclipse plug-ins
running and can be accessed by the Eclipse-based available at https://tools.hana.ondemand.com.
ABAP development tools, which are the standard SAP Cloud Platform ABAP environment is
development tools for SAP Cloud Platform ABAP embedded into the Cloud Foundry environment of
environment. SAP Cloud Platform, which allows ABAP applica-
The cloud-based ABAP system is based on the tions to use other services of SAP Cloud Platform,
same ABAP kernel used for SAP S/4HANA Cloud such as SAP Leonardo. The traditional change and
1808. Its primary purpose is to provide a develop- transport concept is still in place from a logical per-
ment and runtime environment for SAP Fiori spective, meaning that you can develop an ABAP
applications that are decoupled from the digital application in one system and then transport it into
core and optimized for SAP HANA using a REST- a test or productive system, for example. However,
ful programming model, a services-based approach, in contrast to the on-premise world, where trans-
and a cloud-optimized ABAP language. While SAP port requests are exported to the central direc-
Fiori applications created in the cloud-based ABAP tory of a landscape (typically under /usr/sap/trans)
environment are based on the consumption of and then imported into the target system, in SAP
CDS views that are exposed as services through the Cloud Platform ABAP environment, the transport
OData protocol and presented with corresponding requests are exported in readable format to a Git
SAP Fiori elements, simple transactions are also sup- repository. This enables you, for example, to export
ported. The ABAP applications connect to back-end the same ABAP artifact in different versions, which
systems through standard protocols such as HTTP is not possible in the traditional on-premise world.

SAP CLOUD
PLATFORM SAP CLOUD
COCKPIT PLATFORM
ABAP PLATFORM
AS A SERVICE BACK-END SYSTEM
ABAP For example:
DEVELOPMENT • SAP S/4HANA Cloud
TOOLS IN SIDE-BY-SIDE EXTENSION
ECLIPSE with new RESTful ABAP AND • SAP S/4HANA
HTTP SERVICES
programming model:ABAP
NEW RESTful • SAP ERP
SERVICES
ECOSYSTEM PROGRAMMING
• SAP Fiori MODEL • SAP NetWeaver Application
Utilizes:
• Core data services Server ABAP
For example:
• SAP Fiori
• Cloud-optimized ABAP language
• User management
• Core data services
• Machine learning
• Cloud-optimized ABAP language
• Internet of Things EXTERNAL HTTP
SERVICE
GIT CODE
MANAGEMENT

SAP HANA

Figure 1 The overall architecture of SAP Cloud Platform ABAP environment

SAPinsiderOnline.com | Issue 3 • 2018


With this approach, Git-aware tools that support if you are familiar with using the Eclipse-based
continuous integration and delivery can benefit ABAP development tools for on-premise ABAP
from the source representation in Git, making the development, since SAP Cloud Platform ABAP
ABAP world more open to cloud innovations. environment uses the same set of tools.2 Cloud
So, what does development look like in SAP Cloud development is simply carried out in a new Eclipse
Platform ABAP environment? Let’s take a look. project perspective: ABAP Cloud Project.
In the Eclipse IDE, create an ABAP Cloud Proj-
Setting Up the Environment ect by following the menu path New > Project and
To give you an idea of how development works in selecting the corresponding wizard. Then config-
SAP Cloud Platform ABAP environment, we will ure the system connection to the Cloud Foundry
walk through how to develop an ABAP back-end environment for SAP Cloud Platform. First, select
service for consumption in an SAP Fiori applica- a “region” — that is, where your cloud provider
tion. Before we start our development work, how- runs the data center you want to work with. (While
ever, we must set up the development environment initially only the Amazon Web Services cloud pro-
by creating an ABAP instance in SAP Cloud Plat- vider in the Frankfurt region is supported, addi-
form and creating a project in the Eclipse IDE. tional regions and cloud providers will become
available in the future.) Then enter the credentials
Create an ABAP Instance with SAP Cloud for your SAP Cloud Platform account.
Platform Cockpit Next specify the instance details, including the
The first task is for an administrator — or a devel- Cloud Foundry organization and space, and select
oper with the appropriate privileges — to create an the ABAP instance to use for the connection from
ABAP instance. The Service Marketplace within the drop-down list of available instances that were
SAP Cloud Platform cockpit lists all the available displayed in SAP Cloud Platform cockpit. For the
services, including SAP Cloud Platform ABAP envi- example, we select the instance TechEd App Center.
ronment, which is listed as ABAP System. Clicking Log in to your ABAP back end — TechEd App
on ABAP System displays a list of already active Center in the example — using your SAP Cloud
ABAP instances that you have started in your SAP Platform credentials. The system responds with a
Cloud Platform account. You can create a new ABAP URL for the ABAP back end, which will be used to
system by clicking on New Instance. In the example, identify your back-end connection (see Figure 2).
we have created the instance TechEd App Center. You can then name your project (P15_Dev in
the example) and add a favorite package to contain
Create an ABAP Cloud Project in Eclipse your local development objects — for the example,
Next, we need to create an SAP Cloud Platform
2
Information on the supported Eclipse environment for the
ABAP environment development project using ABAP development tools is available at https://tools.hana.
the Eclipse IDE. You will find this task fairly easy ondemand.com.

Figure 2 The configured connection includes a URL for the ABAP back end that will be used to identify your
back-end connection

SAPinsiderOnline.com | Issue 3 • 2018


we choose the predefined package ZLOCAL for ABAP environment, including APIs, CDS views,
local development. Clicking on Finish takes you and dictionary objects (see Figure 3). This list con-
to the familiar Project Explorer overview in the tains important ABAP classes for the ABAP run-
Eclipse IDE workspace, which now includes your time environment and various dictionary elements.
newly created project and the package for local It is important to note that tables are not included
development. From this point on, your develop- as whitelisted objects, which means that an ABAP
ment work will be similar to any other project that statement referring to a standard ABAP table will
uses the Eclipse-based ABAP development tools. cause a syntax error. You must use a whitelisted
When you next log in, you can select your devel- API to access any underlying tables. This approach
opment project by simply logging in to the ABAP is different from ABAP on premise, where you can
back end — just click on the project name in the access almost any ABAP repository element, even if
Eclipse IDE and log in with your credentials — it was never intended for use in custom code.
without the need to drill down from the Amazon With SAP managing the cloud-based environ-
Web Services data center in Frankfurt. ment — and not the customer, as in on-premise
deployments — all upgrades, patches, and hotfix
Using the Development Tools collections are applied independently of the cus-
With the ABAP Cloud Project configured, we’re tomer’s project at predefined maintenance inter-
now ready to start our development work. Here, vals, which are kept as short as possible to provide
we’ll create an ABAP back-end service for con- maximum availability of the cloud environment.
sumption in an SAP Fiori application using the For cloud operations, this means that custom code
well-known flight example to demonstrate the must strictly adhere to the whitelisted objects,
steps in the development environment. Before which are managed in a compatible way so that
beginning the development tasks, however, it is the customer can continue with development or
important to understand that with SAP Cloud Plat- production uninterrupted by maintenance. In an
form ABAP environment, the ABAP language has on-premise environment, a customer would exe-
been optimized for cloud operations, meaning that cute transaction SPAU (Process After Upgrade) to
certain language elements that have been used in adjust any custom code to the new SAP repository
on-premise development are no longer allowed. version. In cloud environments, this approach is
To help ensure smooth operations in the cloud, simply unacceptable.
the Released Objects node in the Project Explorer SAP will extend the whitelist based on customer
navigation tree lists all the whitelisted objects avail- and partner demand, but to keep ABAP innova-
able for development use in SAP Cloud Platform tion up to speed, not all legacy frameworks can be

Figure 3 The Released Objects node in the Project Explorer navigation tree lists all the whitelisted objects available for
development in SAP Cloud Platform ABAP environment

SAPinsiderOnline.com | Issue 3 • 2018


moved to the cloud. This is similar to Java, where environment, all ABAP artifacts are represented by
frameworks such as Web Dynpro could not be native Eclipse editors within the workspace.
moved to SAP Cloud Platform and were instead
replaced with SAP Fiori and SAPUI5. Develop a Console Application to Populate
With these guidelines in mind, let’s now begin the Database Table
our development work, which starts with creating To spool some data into the new ZFLIGHTS data-
a package to contain our development objects. base table, we need to develop a console applica-
tion, which is similar to a traditional ABAP report
Create an ABAP Package to Contain the in the on-premise world. The console application
Development Objects is essentially an ABAP class that performs some
First, create an ABAP package in your ABAP Cloud actions — in the example, it performs database
Project (the P15_Dev project in the example) that insert operations — and writes messages to the
will contain all the artifacts for the ABAP back- console.
end service. In the Project Explorer navigation To create the class, right-click on the ABAP pack-
tree in the Eclipse IDE workspace, right-click on age, select ABAP Class to start the wizard, and then
the ZLOCAL package you added for local develop- enter a name (Z_LOADFLIGHTS) and description
ment, which will serve as the superpackage for the for the class. The class is now included in the Proj-
new package, and select ABAP Package to start the ect Explorer and displayed in the editor within the
wizard. Name the package Z_MYFLIGHTS, add a Eclipse IDE workspace (see Figure 4). The class
description, and specify a package type. uses the previously defined table ZFLIGHTS and
creates database records from an internal table
Create a Database Table to Hold the Data called it_flights, which is defined by the data dec-
Next, create a database table by right-clicking on laration statement. Running this class (by pressing
the newly created package (Z_MYFLIGHTS), select- F9) inserts data into the ZFLIGHTS table.
ing ABAP Repository Object, and choosing Data- When developing an application in SAP Cloud
base Table from the list of Dictionary tools. Enter Platform ABAP environment, keep in mind
a name (ZFLIGHTS) and description for the table. that statements that violate the previously men-
The ZFLIGHTS table now appears in the Project tioned whitelist, such as dynamic SQL, will raise
Explorer navigation tree and is displayed in the table a syntax error. When SAP Cloud Platform ABAP
editor within the Eclipse IDE workspace, which environment has more comprehensive runtime
replaces the former ABAP dictionary transaction checks, some of the dynamic capabilities in ABAP
(SE11). Note that with SAP Cloud Platform ABAP will again be released, but as with the whitelist

Figure 4 The Z_LOADFLIGHTS class displayed in the editor within the Eclipse IDE workspace

SAPinsiderOnline.com | Issue 3 • 2018


approach, the philosophy is to start small and Binding Type Information in the editor pane.
extend the cloud capabilities step by step. The information includes an executable URL that
shows the metadata of the OData service. A pre-
Define a CDS View to Retrieve Data from the view functionality is planned for a future version
ABAP Back End that will enable you to examine the data provided
Now that we have a base table for the CDS defi- by the service independent of a concrete UI client.
nition, we can define a CDS view that retrieves
data from the ABAP back end (the ABAP instance Create a Communication Scenario to Provide
TechEd App Center specified earlier) — in the Authentication
example, it selects an LH flight. To create the CDS The final ABAP development task required to make
view, right-click on the ABAP package, select ABAP the service ready for use is to create a communica-
Repository Object, and choose Data Definition tion scenario. Right-click on the ABAP package,
from the list of Core Data Services tools. Enter a select ABAP Repository Object, and choose Commu-
name (ZLHflights) and description for the view. nication Scenario from the list of Communication
The code for the CDS view is now displayed in the Management tools. Name the communication sce-
editor within the Eclipse IDE workspace, where the nario (ZFLIGHTCOMM) and provide a description.
developer can then define the necessary fields and Next, in the editor pane within the Eclipse IDE
the data from the base table is restricted simply by workspace, specify the authentication and autho-
a corresponding where clause. rization for the communication scenario in the
Inbound Settings on the Inbound tab. For simplic-
Create a Service Definition to Expose the ity, we use basic authentication (that is, user name
CDS View and password) for the example. The role is assigned
To expose the CDS view through OData, you must automatically. We then add an inbound service for
create a service definition — right-click on the ABAP the communication scenario (ZFLIGHTBINDING_
package, select ABAP Repository Object, and then IWSG), which is derived from our flight service
choose Service Definition from the list of Business binding. The communication scenario can then be
Services tools. Enter a name (ZFlightservice) and published on the Overview tab in the editor pane,
description. The code for the service definition is which adds the service details to the Inbound Ser-
displayed in the editor within the Eclipse IDE work- vice fields on the Inbound tab (see Figure 5 on the
space, where the developer can specify the services next page).
to be exposed. While the service definition corre-
sponds roughly to the @odata:publish: true anno- Enabling Access to the ABAP Back End
tation well-known in the on-premise world, with With the ABAP development steps complete, there
SAP Cloud Platform ABAP environment, you need are just two tasks that remain to enable access to
to define the nature of your service more precisely the ABAP back end and make the service ready for
using a service binding. consumption:
OData comes in two different versions, which ■■ An administrator must configure communica-
both support application-to-UI communication tion with the service
and application-to-application communication. To
■■ The developer must create an SAP Fiori template
enable an application-to-UI communication for
that consumes the service
the example, we create a service binding based
on the version 2 specification by right-clicking on It is useful for developers to understand the
the ABAP package and selecting Service Binding mechanics of the administrative tasks described
from the list of Business Services tools. Name the here — in particular, because the settings contain
binding (ZFLIGHTBINDING), provide a descrip- information required for creating the SAP Fiori
tion, and associate the newly created flight service template.
(ZFLIGHTSERVICE).
Next, in the editor pane within the Eclipse Configure Communication with the Service
IDE workspace, publish the service by clicking on To make the service available for consumption, sev-
Publish Locally, which populates the fields under eral administrative tasks are required. Instead of

SAPinsiderOnline.com | Issue 3 • 2018


Figure 5 Publish the communication scenario

using the ABAP development tools, the administra- will be used in the SAP Web IDE project when creat-
tor uses SAP Fiori launchpad, which contains tiles ing the SAP Fiori template to consume the service.
for the administrative tasks. First, the administrator
must configure a communication user that logs on to Create an SAP Fiori Template to Consume
the ABAP back end (the TechEd App Center ABAP the Service
instance) and executes the flight service returning The final task is to create an SAP Fiori template that
the LH flights. Enter a user name (P15_WEBIDE in consumes the service using SAP Web IDE, which is
the example), a description, and a password. an SAP Cloud Platform service for the Neo environ-
Next, to handle the inbound and outbound com- ment. Remember that SAP Cloud Platform ABAP
munication, a communication system must be environment is a service for the Cloud Foundry envi-
defined — in the example, with WEBIDE_BASIC as ronment — for this reason, we use the full stack SAP
the system ID and name — that describes the ABAP Web IDE that can access Cloud Foundry services,
back end. Lastly, a communication arrangement is which is accessible via SAP Cloud Platform cockpit.
defined, named ZFLIGHTCOMM in the example, First, in SAP Cloud Platform cockpit, define a
that bundles together the communication user and destination that provides access to the ABAP back
communication system (see Figure 6). Note that the end. Specify the destination information, includ-
communication arrangement contains the URL that ing a name (P15_WEBIDE_BASIC in the example),
identifies the service (ZFLIGHTBINDING), which the URL from the communication arrangement

Figure 6 The completed communication arrangement definition

SAPinsiderOnline.com | Issue 3 • 2018


Figure 7 Define the destination that provides access to the ABAP back end

Figure 8 Specify the service URL, which will display the metadata of the service in the application

definition, and the corresponding communication server running on a 64GB SAP HANA database,
user defined previously (see Figure 7). which is €3,000 per month per customer. Custom-
Next, select New Project from Template on the ers can choose between subscription billing and
start screen of SAP Web IDE. Name the project — pay-per-use billing, similar to other services offered
Flights in the example — and specify the service through SAP Cloud Platform.
URL from the communication arrangement defini- With SAP Cloud Platform ABAP environment,
tion that represents the LH flights, which will dis- SAP customers and partners have the opportunity
play the metadata of your service (see Figure 8). to move their ABAP skills and assets to the cloud.
Specify the OData collection — the CDS view cre- Cloud operation requires stricter compatibility rules
ated earlier, ZLHflights — and generate the project. compared to on-premise ABAP development, but
The components of the finished project are shown the benefits are significant and include access to
in the Project Explorer of SAP Web IDE. From there, innovative ABAP capabilities on top of SAP HANA.
you can launch the application, which retrieves the The development tools are fully based on the user-
data and displays it in a list report template. friendly Eclipse IDE, and the development environ-
ment can be used to extend SAP S/4HANA Cloud
Summary as well as recent on-premise installations of SAP
SAP Cloud Platform ABAP environment is available S/4HANA and SAP Business Suite (version 7.0 of
as of September 2018 and is priced in two dimen- SAP NetWeaver and higher), enabling you to use
sions: ABAP memory and SAP HANA memory. your existing ABAP expertise together with cloud
The minimal setup is a 16GB ABAP application innovation to tap into a new world of opportunity.

SAPinsiderOnline.com | Issue 3 • 2018

You might also like