ABAP SDK Hackathon
ABAP SDK Hackathon
1
Inhalt
Introduction............................................................................................................................................. 3
Activate Azure Pass ................................................................................................................................. 4
Deploy SAP NetWeaver System via SAP Cloud Appliance Library........................................................... 9
Configure Azure Event Hub ................................................................................................................... 19
Connect to the SAP System using the SAP GUI ..................................................................................... 26
Setup SSL Trust ...................................................................................................................................... 29
Install abapGit ....................................................................................................................................... 37
Install ABAP SDK for Azure .................................................................................................................... 40
Configure RFC Destination and ABAP SDK for Azure............................................................................. 44
Create Demo Data to send to Azure ..................................................................................................... 52
Send Message from SAP System ........................................................................................................... 53
Monitoring in SAP System ..................................................................................................................... 55
Create Logic App to React on new Events ............................................................................................. 56
Optional: Connect to the Front End System.......................................................................................... 70
Agenda
• Setup SAP NetWeaver System
• Presentation & Overview
• Install and use ABAP SDK for Azure
History
Date Comments Author Version
08.08.2018 Initial version hobruche 0.1
07.09.2018 Feedback from PM & customer implemented hobruche 0.5
11.09.2018 Switch to hobru-github (SUCU issue) Hobruche 0.6
17.09.2018 Final changes for v1 Hobruche 1.0
20.09.2018 Feedback form first Hackathon, Bigger VMs Hobruche 1.1
07.02.2019 Preparation for DSAG TT19 Hobruche 1.2
2
Introduction
The ABAP SDK for Azure is a result of several projects within Microsoft-IT. Out of several individual
projects that all wanted to connect from our SAP Systems to Azure a centralized ABAP SDK for Azure
was developed.
After using the SDK for several months internally Microsoft-IT decided to publish the code on GitHub.
We then enhanced the installation process and are currently working with several SAP Mentors and
SAP customer on new ideas.
The goal of the ABAP SDK for Azure is to simplify the consumption of service in Azure from ABAP as
best as possible.
In our scenario we will use the Microsoft Azure Event Hub to push information from SAP to Azure.
Once in Azure we will create a Logic App application that sends this information via Email to a user.
Although this could obviously be done directly from ABAP, the goal here is to introduce different
components and guide you through a full end-to-end process.
You will work with the Azure Portal (http://portal.azure.com) and the SAP Cloud Appliance Library
(http://cal.sap.com ).
Most of the files are available via GitHub. The abapGit can be found at
https://github.com/larshp/abapGit the ABAP SDK for Azure can be found at
https://github.com/Microsoft/ABAP-SDK-for-Azure
3
Activate Azure Pass
In this tutorial you are going to leverage an Microsoft Azure Pass. This pass allows you to use Azure
for one month free of charge for up to $100.
You can also run through this tutorial with your own existing Azure Subscription or get your own
Free Trial Subscription using http://azure.com/free The main difference to using an Azure Pass is
that you will have to enter a credit card information. Please keep in mind that this credit card will
not be charged unless you explicitly change this setting. The credit card information is just used to
make sure that you are a “real person”.
Go to
http://www.microsoftA
zurePass.com
Click on Start
And log-in with your
Microsoft user
4
Click on Confirm
Microsoft Account
5
Click on Activate
6
Accept the Terms &
Conditions and click on
Register
7
Click on your user under
Billing Scope (e.g.
dsagtt19-
a@outlook.com)
8
Deploy SAP NetWeaver System via SAP Cloud Appliance Library
The SAP Cloud Appliance Library offers over 100 preconfigured solutions from SAP. You can pick
from a list of these solutions and create your very own instance. A lot of the solutions offered are
free of charge, others can be run for 30 days in a trial, a few need to be activated by SAP first.
If you want to use the SAP Cloud Appliance library for any of the non-free solutions you can get a
subscription from SAP via https://www.sapstore.com/solutions/99007/SAP-Cloud-Appliance-
Library
Go to
http://cal.sap.com and
click on Log On
9
Accept Terms &
Conditions
Click on Accounts
10
Enter the following
Details:
Name: Azure
Subscription
Cloud Provider:
Microsoft Azure
Subscription ID: <enter
the ID from the
previous step>
Click on Authorize
11
Accept the required
permissions so that the
SAP Cloud Appliance
library can create
resources in your Azure
Subscription.
12
Validate the Settings
and click on Review
13
select this system and
not 7.52!
Accept Terms &
Conditions by clicking
on I Accept
Click on Advanced
Mode
Click on Step 2
14
Enter
Name: SAP NetWeaver
7.51
Click on Step 3
15
Enter a password and
click on Step 5
Click on Review
And on Create
16
Confirm the selected
VM by clicking OK
17
Deployment of the
System takes around 30
minutes and additional
45 minutes to activate.
Note: While
waiting for the
deployment,
continue with
step “
18
Configure Azure Event Hub
The Azure Event Hub is a Big Data streaming platform and event ingestion service, capable of
receiving and processing millions of events per second. Event Hubs can process and store events,
data, or telemetry produced by distributed software and devices. Data sent to an event hub can be
transformed and stored using any real-time analytics provider or batching/storage adapters.
In our example we will use the Azure Event hub to retrieve a very small number of SAP Flight
Information (based on the famous SAP FLIGHT (SFLIGHT) Model) and process it later on.
For more information on the Azure Event Hub check out https://azure.microsoft.com/en-
us/services/event-hubs/ More information on SFLIGHT can be found here
https://help.sap.com/doc/saphelp_nw70/7.0.31/en-
US/cf/21f304446011d189700000e8322d00/content.htm?no_cache=true
To retrieve information
from SAP you need to
setup an Event Hub in
Azure.
Log on to
http://portal.azure.com
with your Microsoft
User.
Click on + Create a
resource and enter
Event Hubs (Hit Enter to
start the search)
19
And click on Create
20
Enter details for
Name: ABAPSDK-EH-
<yourname>
Click on Create
21
And click on the
Resource, ABAPSDK-EH
Enter a Name:
SAPEvents
And click on Create
22
Once the creation of the
Event Hub is finished,
click on Entities -> Event
Hubs
23
Click on + Add
24
Information you should
have in Notepad now
25
Connect to the SAP System using the SAP GUI
Go to the Instance you
just created and click on
Connect
26
Login with user
DEVELOPER and the
Password you had
previously provided
27
28
Setup SSL Trust
Unlike popular browsers an SAP systems does not come with preinstalled root SSL certificates for
security reasons. Administrators have to make a conscious decision and import the SSL certificate
that are required for individual scenarios.
In the following steps you will import SSL certificates from GitHub (required to use the abapGit
program) and Azure (to connect to Azure Event Hub).
In order to access site
from GitHub and later
on from Azure we need
to import SSL
Certificates.
We have downloaded
both Root Certificates
and made them
available for easier
access.
Go to Transaction
STRUST
http://aka.ms/sap/GitH
ubSSL
http://aka.ms/sap/Azur
eBusSSL
to download the
necessary Azure Service
Bus Site SSL.
29
In Trust Manager, Click
on the Edit Button, then
double click on SSL
client SSL Client
(Anonymous)
And click on the Import
Certificate button at the
bottom of the screen.
Click on Allow
30
Click on Add to
Certificate List to add
the GitHub Certificate
to the Certificate List
31
Since GitHub is
abort/rejecting TLSv1.0
handshakes the SAP
systems needs to be
configured accordingly.
Go to transaction
/nRZ10, select the
Profile
NPL_D00_VHCALNPLCI,
Version: 1
Select Extended
maintenance
And click on Change
Click OK on the
Information screen
Click on Parameter to
add a new Parameter to
the profile
Parameter value:
135:PFS:HIGH::EC
_P256:EC_HIGH
32
Go back and Save the
changes.
Parameter value:
150:PFS:HIGH::EC
_P256:EC_HIGH
33
Again go back and save
the changes.
34
Note: If you get error
message, just ignore
them and continue the
activation.
Click on OK
35
For this go back to the
SAP Cloud Appliance
Library, select your
Instance, if required
click on the three dots
and click on Reboot
Click on OK to gracefully
shutdown the SAP
system and restart it.
Note: When
reconnecting just make
sure to select Client 001
again!
36
Install abapGit
abapGit is a git client for ABAP. It dramatically simplifies the way how you can work with custom
developments and version control via Git in your SAP system. At the same time abapGit also
makes it extremely easy to import other applications into your ABAP system.
More details about abapGit can be found at http://docs.abapgit.org/
Download the latest
version of abapGit from
http://aka.ms/sap/abap
git
Go the Transaction
/nSE38
Enter the program
name zabapgit and click
on Create
38
Click on Activate to
Save and Activate the
program.
The status should
change to Active.
39
Install ABAP SDK for Azure
The ABAP SDK for Azure simplifies the way how ABAP developers can work and consume services
from Azure. RFC destinations, configurations and security settings are consolidated to help
organizations track and monitor traffic between their SAP systems and Azure.
More information about the ABAP SDK for Azure can be found at
https://github.com/Microsoft/ABAP-SDK-for-Azure
If required go back to
transaction /nSE38 and
enter zabapgit as the
program name.
In abapGit click on +
Online to retrieve ABAP
code from GitHub
Then click OK
Back at the New online
Project screen, click OK
again
Click on Pull to
download all required
files.
41
If you are prompted to
Overwrite, select your
Object Name and click
on OK
When prompted to
create Objects, click on
Local Object
42
Click on OK to run the
final check and activate
all objects.
43
Configure RFC Destination and ABAP SDK for Azure
The ABAP SDK for Azure uses a set of RFC destination for each Azure Service. This simplifies the
management and tracing of ABAP calls to Azure.
In addition a set of customizing tables determine what scenarios from Azure are exposed to your
SAP System and how they can be used.
Click on OK in the
Information dialog.
44
Enter the Target Host as
full namespace URL that
you wrote down in
Notepad, e.g. abapsdk-
eh.servicebus.windows.
net
The Port is 443
And the Path Prefix is
/<Event Hub
Instance>/messages,
e.g.
/sapevents/messages
Click on Logon & Secur
46
In the next step you
need to configure the
ABAP SDK.
Go to transaction
/nSM30,
enter the Table name
ZREST_CONFIG
and click on Maintain
In the maintenance
screen click on New
Entries
Enter an Interface ID
HACK-EH and the name
of the RFC Destination
you just created,
ABAPSDK-TO-
EVENTHUB
47
When prompted for
Customizing Request,
click on Create Request
Click on Maintain
48
In the Maintenance
screen click on New
Entry
49
Once the entries are
saved, go back to
transaction /nSM30 and
enter the table name
ZADF_CONFIG
Click on Maintain
In the Maintenance
screen click on New
Entries
50
Once the entries are
saved, go back to
transaction /nSM30 and
enter the table name
ZADF_EHUB_POLICY
Click on Maintain
In the Maintenance
screen click on New
Entries
Click on Save
51
Create Demo Data to send to Azure
The SAP Flight Model (SFLIGHT) is probably the most known SAP Demo Data scenario in an SAP
System and has been around for a long time. Reflecting an airline scenario, airlines, flight numbers,
and other data is used to explain concepts of SAP.
Now the ABAP SDK is
configured and you can
send data from SAP to
the Event Hub on Azure.
When prompted to
delete old tables, click
on Yes
52
Send Message from SAP System
The ZADF_DEMO_AZURE_EVENTHUB program is a simple report that shows how easy it is to use
the ABAP SDK for Azure to send data from SAP to the Azure Event Hub. Sample data from SLIGHT
is sent to Azure.
The intention of this program is just to showcase one usecase and is certainly not intended for
productive use!
In order to send data
from SAP to the Event
Hub on Azure you can
run a demo program
ZADF_DEMO_AZURE_E
VENTHUB.
Go to transaction
/nSE38, enter the
program name
ZADF_DEMO_AZURE_E
VENTHUB and click on
Change
53
Scroll down to line 37
and change the number
of ROWs from 10 to 2
54
Monitoring in SAP System
You can also monitor and trace the calls that were done directly from the SAP System. The ABAP
SDK Monitor (ZREST_UTIL) allows you to view the history of all the messages that were posted to
Azure Services. This allows you to troubleshoot and re-process messages if required.
From the SAP GUI open
Transaction ZREST_UTIL
55
Create Logic App to React on new Events
Azure Logic Apps simplifies how you build automated scalable workflows that integrate apps and
data across cloud services and on-premises systems. Hundreds of preconfigured triggers and
connectors are available that help react to events, mash-up information and send data to other
systems.
More information about Logic Apps can be found at https://azure.microsoft.com/de-
de/services/logic-apps/
Now that the data is in
Azure, you can work
with this information.
One easy way to build
application or actions in
Azure is Logic Apps.
56
Click on Create
57
Enter a Name, e.g.
LogicAppForABAPSDK
And select the existing
Resource Group
ABAPSDK-EH-RG which
you created before.
58
Once the deployment is
finished, click on Go to
Resource
59
Search for Event Hub
And select “When
events are available in
Event Hub”
Enter a Connection
Name: ABAP-SDK-
DEMO and click on the
ABAPSDK-EH
Click on the
RootManageSharedAcc
essKey
And then on Create
60
Click on Name of the
Event Hub and …
61
The content from SAP
available in Logic Apps
is Base64 Encoded.
So first it has to be
decoded.
Search for Compose
and select Compose –
Data Operations
Click on Inputs
Switch to Expressions
and enter
base64ToString(tri
ggerBody()?['Conte
ntData'])
Then click on OK
62
Search for Json and
select
Parse JSON – Data
Operations
63
Click on + Next Step
64
Click on Sign In
65
Enter your password
and click on Log On
66
Allow Logic App to use
your Outlook account
and click on Yes
67
Click on the Body line
and select carrid on the
right hand side
68
Click on Save to save
the Logic App
69
Optional: Connect to the Front End System
If you do not have an SAP GUI Installed on your laptop, please follow the steps outlined at the end
of the document to connect via Remote Desktop to a Front-End System.
In the SAP Cloud
Appliance Library under
Instances -> SAP
NetWeaver 7.51 click on
Connect
Click on Connect to
connect to the Server
70
Enter your Password
which you used for the
SAP Instance and click
on OK
71
After a few minutes you
are connected to a
Server that hosts all the
required tools to
connect to the SAP
System. Among them a
fully configured SAP GUI
72
Minimize the Browser
and open the SAP
Logon from the Desktop
73
From the SAP Logon
pad select the SAP
System NPL and
connect.
74