Skip to Content
Previous

Using ABAP with the SAP API Business Hub

By Meredith Hassett

Add a code snippet from the API Hub into your ABAP report.

You will learn

In this tutorial, you will learn how to use the pre-generated code from the SAP API Business Hub in an ABAP report. You will need to have configured your ABAP system to make an HTTP request.

Details

Configuring the proxy settings is not a required step for all systems. Verify that your system needs to have the proxy configured before completing steps 1 through 3.


Step 1: Configure your ABAP Proxy

From the SAP Logon pad, launch the SAP Logon screen.

ABAP SAP logon screen

Enter the login credentials in R/3 ABAP System.

logon credentials screen

Configure your proxy settings by going to transaction SICF and clicking on Execute.

proxy settings

Open Proxy settings page by pressing Ctrl + F2 and set the proxy.

proxy configuration screen
Step 2: Get your SSL Certificate

In Google Chrome, export SSL certification.

Google chrome SSL certificate

To get to the SSL certificate, enter F12, go to Security tab, click on View Certificate, click on Details, and select Copy to File. From here, you can export the certificate by path.

SSL Certificate details
Step 3: Add your certificate to ABAP

Once you export the certificate by path, you will need to import it into your ABAP system. To import the certificate in your ABAP system, go to the transaction STRUST, open SSL client SSL Client (Standard), and switch to Edit mode.

ABAP trust manager

Click on Import Certificate. Select the certificate you exported from Google Chrome in the previous step. Click Add to Certificate List and save.

SSL client SSL client standard certificate

In order to reflect your new SSL settings, you will need to restart your ICM. To restart the ICM, go to the transaction SMICM. Navigate to Administration > ICM > Exit Hard > Global.

location of global restart option

The ICM restart message will appear. Select Yes.

ICM restart message

Restart the ICM processes. Make sure no client is communicating during restart.

Step 4: Create the ABAP program report

In your ABAP system, go to the transaction se38.

ABAP editor initial screen

Create a new report. Enter the program name, such as ZAPI_HUB_TEST, select Source Code, and click Create.

report creation screen

Provide the following details on the Program Attributes screen.

Field Name Value
Title testing API
Type Executable program
OPTIONAL: Status Test Program

Save, Activate, and Execute the report.

report program attributes
Step 5: Get the ABAP code from API Business Hub

To get the ABAP code snippets that are available in the SAP API Business Hub, go to the SAP API Business Hub, which can be found at api.sap.com, from your browser. Navigate to the API packages page and find the SAP Translation Hub API.

translation hub API

Click the Expand Operations link on the Domains API. Click Generate Code on the GET /domains method.

GET domains API method

Click on the tab for ABAP from available languages and click Copy to Clipboard.

ABAP code snippet
Step 6: Add API call and run from ABAP

Back in your ABAP system, paste the code snippet into the report.

ABAP report with added code snippet

Replace the <API_KEY> with your API key value. This is also available in the SAP API Business Hub and is specific to your user and app. Save, Activate, and Execute the report.

successful API call from ABAP

If you see a message returned with data, and not an error, you have successfully tested a call to an API from the SAP API Business Hub.

Next Steps

Updated 09/13/2017

Time to Complete

15 Min

Beginner

Tags

Prerequisites

Next Steps

Next
Back to top

Call me now