0% found this document useful (0 votes)
353 views12 pages

Testing SAP S4HANA Cloud API Services

This document provides information about testing SAP S/4HANA Cloud API services. It describes two options for testing - using the SAP API Business Hub sandbox or testing with your own SAP S/4HANA Cloud system. The document covers preparing for testing with your own system, including setting up communication management and authentication.

Uploaded by

karim sefiani
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
353 views12 pages

Testing SAP S4HANA Cloud API Services

This document provides information about testing SAP S/4HANA Cloud API services. It describes two options for testing - using the SAP API Business Hub sandbox or testing with your own SAP S/4HANA Cloud system. The document covers preparing for testing with your own system, including setting up communication management and authentication.

Uploaded by

karim sefiani
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 12

PUBLIC

Document Version: 2.0.0 – 2020-04-30

Testing SAP S/4HANA Cloud API Services


© 2020 SAP SE or an SAP affiliate company. All rights reserved.

THE BEST RUN


Content

1 Document History. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3

2 Options for Testing SAP S/4HANA Cloud API Services. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .4

3 Test with the SAP API Business Hub Sandbox. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .5

4 Test with Your Own SAP S/4HANA Cloud System. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .6


4.1 Prepare for Testing. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
Set Up Communication Management. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
Provide an Authentication Option. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
Configure a New API Environment. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
4.2 Start Testing on Your Own System . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9

Testing SAP S/4HANA Cloud API Services


2 PUBLIC Content
1 Document History

This section documents the updates and changes in this document.

Document Version Date Comment

1.0.0 2017-09-21 Initial Version

2.0.0 2020-04-29 Updated sections as per the changes in


the SAP API Business Hub.

Testing SAP S/4HANA Cloud API Services


Document History PUBLIC 3
2 Options for Testing SAP S/4HANA Cloud
API Services

You can test the provided APIs in the SAP S/4HANA Cloud package with your own SAP S/4HANA Cloud
system. or You can also test with the SAP API Business Hub sandbox system provided to our customers and
partners.

How does testing benefit you?

You can easily test the APIs by using the Try Out feature on the API References tab of an API service. Testing
SAP S/4HANA Cloud APIs helps you find out more about how an API service is structured and whether it is
suitable for your business needs. You have the option of calling the API on your own SAP S/4HANA Cloud
system with your own test data. And you can retrace how requests need to be built and see what responses you
can expect. If you don't have access to your own SAP S/4HANA Cloud system, you can test the APIs with the
SAP API Business Hub sandbox system.

 Note

These are the constraints when testing SAP S/4HANA Cloud APIs:

● Testing of SAP S/4HANA Cloud APIs that are available on the SAP API Business Hub (API Hub) can
only be provided for OData services.
● You can test only READ operations on the sandbox system of the SAP API Business Hub. However, SAP
S/4HANA Cloud API services support both READ and WRITE operations.
● In this guide, we describe the testing for inbound services as only these services can be used on an SAP
S/4HANA Cloud system. Outbound services are services provided by other systems or third party
software components outside of SAP S/4HANA Cloud.

Testing SAP S/4HANA Cloud API Services


4 PUBLIC Options for Testing SAP S/4HANA Cloud API Services
3 Test with the SAP API Business Hub
Sandbox

The SAP API Business Hub lets you test the SAP S/4HANA Cloud APIs against a public sandbox system that is
dedicated to exploring SAP S/4HANA Cloud APIs.

 Note

You need to be logged on to SAP API Business Hub to use the Try out feature. For more information, see
Trying Out APIs in the Sandbox Environment at https://help.sap.com/viewer/product/
SAP_API_BUSINESS_HUB/Cloud/en-US under End User Information Exploring the SAP API Business
Hub API Packages Trying Out APIs Trying Out APIs in a Sandbox Environment (https://
help.sap.com/viewer/84b35b9c39b247e3ba2a31f02beee46d/Cloud/en-US/
74fa07983b1c41ffba251e14e4c31a11.html).

To test an API service with the API Business Hub Sandbox, proceed as follows:

1. Log on to the SAP API Business Hub with your user.


2. Select the API service that you want to test from the SAP S/4HANA Cloud package.
3. Choose the API References tab of the API service. The API environment is displayed on this tab. By default,
the SAP API Business Hub sandbox system has already been selected.
4. Test to make sure that the API environment can be reached from the API Hub UI. You can do this by
executing any of the available OData operations. These are the GET operations shown in the screenshot
below. The response should show that the API was applied successfully in the target system.

 Example

We are showing the API environment with the example of the Business Events Subscription OData
service. If you go to the API References tab, the operations for each entity set are displayed.
Test with the SAP API Business Hub Sandbox [page 5]
Operations Available for Business Events Subscription

If you expand one of the operations, you'll get UI features that are comparable to the common features in
any REST client.
5. In the final step, just add the parameters that you need for the request (adding more parameters is
optional).
6. Choose Try out to run the test. The SAP API Business Hub triggers a request in the sandbox system. The
response is displayed on the API Hub UI.

Testing SAP S/4HANA Cloud API Services


Test with the SAP API Business Hub Sandbox PUBLIC 5
4 Test with Your Own SAP S/4HANA Cloud
System

SAP API Business Hub lets you test the APIs directly on your own SAP S/4HANA Cloud system. For more
information, see Trying Out APIs in the Productive Environment at https://help.sap.com/viewer/product/
SAP_API_BUSINESS_HUB/Cloud/en-US under End User Information Exploring the SAP API Business Hub
API Packages Trying Out APIs Trying Out APIs in a Productive Environment (https://help.sap.com/
viewer/84b35b9c39b247e3ba2a31f02beee46d/Cloud/en-US/f7796baaef6a48e9867298827f5028ff.html).

To get started, you need to set up communication management and provide an authentication option. To run
the test in your own system, you need to configure a new API environment.

4.1 Prepare for Testing

To start testing, you need to

● Set up communication management


● Provide an authentication option for back-end system access
● Configure a new API environment

We use sample data to demonstrate API testing. In this example, we're using the Business Event Subscription
OData service for demonstration purposes. For more information about this service, choose SAP S/4HANA
Cloud on the SAP API Business Hub under http://api.sap.com . On the APIs tab, choose the API service you
need. For API service documentation, see Business Documentation on the Details tab.

The Business Events Subscription API is part of the Business Event Handling (SAP_COM_0121) communication
scenario. To test this API in your own system, you need to create an SAP_COM_0121 communication
arrangement instance. When you create a communication arrangement instance in the SAP S/4HANA Cloud
and activate it by saving, the service environment will be provided under the Inbound Services section. It will
look like this:

https://<S4HANACLOUD-HOSTNAME>/sap/opu/odata/sap/CA_BEH_SUBSCRIPTION_SRV

Related Information

Set Up Communication Management [page 7]


Provide an Authentication Option [page 7]
Configure a New API Environment [page 8]

Testing SAP S/4HANA Cloud API Services


6 PUBLIC Test with Your Own SAP S/4HANA Cloud System
4.1.1 Set Up Communication Management

You need to set up communication management if you want to consume and test SAP S/4HANA Cloud OData
APIs and integrate your solution with other systems.

Define the Settings in the Communication Management Apps

You need to define settings in these Communication Management apps:

● Communication Users
● Communication Systems
● Communication Arrangements

You need to make these settings because the service environments that are used to call an API are maintained
in the Communication Arrangement setup. You can find these apps on SAP Fiori launchpad in your SAP
S/4HANA Cloud system. To define the settings, proceed as follows:

1. Assign your user to a business role containing the business catalog SAP_CORE_BC_COM for
Communication Management.
For more information, see Product Assistance of SAP S/4HANA Cloud under Extend and Integrate Your
SAP S/4HANA Cloud Integration Communication Management Maintain Communication Users
(https://help.sap.com/viewer/0f69f8fb28ac4bf48d2b57b9637e81fa/latest/en-US/
eef80dda3867461c92ac1273689ed36f.html).
2. Proceed with the steps for configuring the Communication Arrangements apps as described in Product
Assistance for SAP S/4HANA Cloud under Extend and Integrate Your SAP S/4HANA Cloud Integration
Communication Management Communication Arrangements (https://help.sap.com/viewer/
0f69f8fb28ac4bf48d2b57b9637e81fa/latest/en-US/fab3fd449cf74c6384622b98831e989e.html).

Check Communication Arrangement Activation

The API services you want to call need to be part of a communication arrangement that has been activated in
your SAP S/4HANA Cloud system. Check to see whether this activation has taken place.

For more information, see Product Assistance for SAP S/4HANA Cloud under Extend and Integrate Your SAP
S/4HANA Cloud Integration Communication Management (https://help.sap.com/viewer/
0f69f8fb28ac4bf48d2b57b9637e81fa/latest/en-US/2e84a10c430645a88bdbfaaa23ac9ff7.html).

4.1.2 Provide an Authentication Option

To call the service on your own SAP S/4HANA Cloud back-end system, you need to provide the authentication
for the communication user you used to set up the communication arrangement (see Set Up Communication
Management [page 7]). When creating your arrangement, you have the option of choosing different

Testing SAP S/4HANA Cloud API Services


Test with Your Own SAP S/4HANA Cloud System PUBLIC 7
communication systems and users that provide different authentication options for the service. In this
example, we're using the basic authentication option. For more information, see Product Assistance for SAP
S/4HANA Cloud under Extend and Integrate Your SAP S/4HANA Cloud Integration Communication
Management Maintain Communication Users (https://help.sap.com/viewer/
f544846954f24b9183eddadcc41bdc3b/1705%20500/en-US/eef80dda3867461c92ac1273689ed36f.html).

4.1.3 Configure a New API Environment

To test the API services in your own SAP S/4HANA Cloud system, you need to configure a new API
Environment. Proceed with these steps:

1. Log on to the SAP API Business Hub.


2. Select the API service in the SAP S/4HANA Cloud package you would like to test.
3. Choose the API References tab of the API Service. The API Environment is displayed on this tab. By default,
it is set to the SAP API Business Hub sandbox system.

API Environment field on the API References tab of SAP API Business Hub
4. Choose Configure Environments to start creating your new API Environment configuration. A form for
entering the required system information is displayed.
5. Fill in the form as follows:
1. Enter a system alias in the Display Name for Environments field to identify the system for which you are
creating the environment.
2. Enter the host name of the system you are connecting to. You can get this from the API environment
that you can see in the communication arrangement you activated earlier.
3. Enter the port number for https communication (the default is 443).
4. Enter the Basic Auth Username and Password for the inbound communication user you used to
activate the communication arrangement.

Testing SAP S/4HANA Cloud API Services


8 PUBLIC Test with Your Own SAP S/4HANA Cloud System
Configure Environments
6. Choose OK to save your configuration.

4.2 Start Testing on Your Own System

After you've finished your preparations, you can start testing.

1. On the SAP API Business Hub, log on with your user.


2. The API environment is displayed on the API References tab of the API service . By default, it is set to the
SAP API Business Hub sandbox system.
3. In the dropdown menu of the API References tab, select the configuration for your newly created
configuration.

 Note

To test SAP S/4HANA Cloud APIs against your own system using the API Hub UI, you need to configure
SAP API Business Hub to connect to your back-end system. You do this by configuring a new API
environment for your APIs; see Configure a New API Environment [page 8].

4. Test whether you can reach your API environment from the API Hub UI. To do so, execute any of the
available GET operations. As a response, a message appears showing that the API was successfully
invoked in the target system.
Example of a success response for Try Out

Testing SAP S/4HANA Cloud API Services


Test with Your Own SAP S/4HANA Cloud System PUBLIC 9
Testing SAP S/4HANA Cloud API Services
10 PUBLIC Test with Your Own SAP S/4HANA Cloud System
Important Disclaimers and Legal Information

Hyperlinks
Some links are classified by an icon and/or a mouseover text. These links provide additional information.
About the icons:

● Links with the icon : You are entering a Web site that is not hosted by SAP. By using such links, you agree (unless expressly stated otherwise in your
agreements with SAP) to this:

● The content of the linked-to site is not SAP documentation. You may not infer any product claims against SAP based on this information.
● SAP does not agree or disagree with the content on the linked-to site, nor does SAP warrant the availability and correctness. SAP shall not be liable for any
damages caused by the use of such content unless damages have been caused by SAP's gross negligence or willful misconduct.

● Links with the icon : You are leaving the documentation for that particular SAP product or service and are entering a SAP-hosted Web site. By using such
links, you agree that (unless expressly stated otherwise in your agreements with SAP) you may not infer any product claims against SAP based on this
information.

Beta and Other Experimental Features


Experimental features are not part of the officially delivered scope that SAP guarantees for future releases. This means that experimental features may be changed by
SAP at any time for any reason without notice. Experimental features are not for productive use. You may not demonstrate, test, examine, evaluate or otherwise use
the experimental features in a live operating environment or with data that has not been sufficiently backed up.
The purpose of experimental features is to get feedback early on, allowing customers and partners to influence the future product accordingly. By providing your
feedback (e.g. in the SAP Community), you accept that intellectual property rights of the contributions or derivative works shall remain the exclusive property of SAP.

Example Code
Any software coding and/or code snippets are examples. They are not for productive use. The example code is only intended to better explain and visualize the syntax
and phrasing rules. SAP does not warrant the correctness and completeness of the example code. SAP shall not be liable for errors or damages caused by the use of
example code unless damages have been caused by SAP's gross negligence or willful misconduct.

Gender-Related Language
We try not to use gender-specific word forms and formulations. As appropriate for context and readability, SAP may use masculine word forms to refer to all genders.

Videos Hosted on External Platforms


Some videos may point to third-party video hosting platforms. SAP cannot guarantee the future availability of videos stored on these platforms. Furthermore, any
advertisements or other content hosted on these platforms (for example, suggested videos or by navigating to other videos hosted on the same site), are not within
the control or responsibility of SAP.

Testing SAP S/4HANA Cloud API Services


Important Disclaimers and Legal Information PUBLIC 11
www.sap.com/contactsap

© 2020 SAP SE or an SAP affiliate company. All rights reserved.

No part of this publication may be reproduced or transmitted in any form


or for any purpose without the express permission of SAP SE or an SAP
affiliate company. The information contained herein may be changed
without prior notice.

Some software products marketed by SAP SE and its distributors


contain proprietary software components of other software vendors.
National product specifications may vary.

These materials are provided by SAP SE or an SAP affiliate company for


informational purposes only, without representation or warranty of any
kind, and SAP or its affiliated companies shall not be liable for errors or
omissions with respect to the materials. The only warranties for SAP or
SAP affiliate company products and services are those that are set forth
in the express warranty statements accompanying such products and
services, if any. Nothing herein should be construed as constituting an
additional warranty.

SAP and other SAP products and services mentioned herein as well as
their respective logos are trademarks or registered trademarks of SAP
SE (or an SAP affiliate company) in Germany and other countries. All
other product and service names mentioned are the trademarks of their
respective companies.

Please see https://www.sap.com/about/legal/trademark.html for


additional trademark information and notices.

THE BEST RUN

You might also like