SAP Home Learn Build Integrate Model Operate Extend with AI ConnectTutorial navigator Knowledge Graph API Devtoberfest Developer Advocates App Space

Manage my Account SAP Devs YouTube ↗ Learnings ↗ Community ↗ Provide Feedback ↗
Logout
โคข Open full site

Call an External API and Parse the Response (JSON or XML))

Call an external API SAP BTP ABAP Environment and parse the response (JSON or XML)

Overview

🎓 intermediate 20 min. ABAP DevelopmentIntermediateSAP S 4hana Cloud ABAP EnvironmentSAP Business Technology PlatformS 4hana Cloud ABAP Environment

You will learn

  • โœ”How to connect to an external RESTful API, in this case the Overpass street map service: http://overpass-api.de/, by creating the necessary communication artifacts
  • โœ”How to work with HTTP requests in your ABAP code
  • โœ”How to query the service
  • โœ”How to parse the information in an ABAP class using either JSON and SAP’s XCO Library or using XML and a simple transformation
  • โœ”How to create an executable class and display the output in the ABAP console This tutorial enables you to work with data from an external RESTful API in your ABAP applications. Throughout this tutorial, object names include the suffix 000. Always replace this with your group number or initials. > This tutorial was written for SAP BTP ABAP Environment. However, you should also be able to use it in SAP S/4HANA Cloud Environment in the same way.
Julie Plummer J Julie Plummer August 7, 2025
Created by March 9, 2023
Contributors

Prerequisites

Prerequisites

Steps

Step 1 Create package
โ€”

  1. In ABAP Development Tools (ADT), select your ABAP Cloud Project and choose New > ABAP Package from the context menu.

  2. Enter the following and choose Next:

    • Super-package: Your super-package, if you are using one
    • Name = Z_API_OVERPASS_000
    • Description = Get map data using Overpass map service API
    • Add to favorite packages = Yes
    • Package type = Development

    step1a-create-package
    step1a-create-package

  3. Choose Create new transport request, enter a description, such as Get data from API Overpass, then choose Finish.

    step1c-new-transport-request
    step1c-new-transport-request

Step 2 Create outbound service
+
Step 3 Create communication scenario in ADT
+
Step 4 Create communication system in Fiori Launchpad
+
Step 5 Create communication arrangement
+
Step 6 Create transformation (XML only)
+
Step 7 Create ABAP class
+
Step 8 Implement method
+
Step 9 Activate code
+
Step 10 Run class in ABAP Console
+
Step 11 Test yourself XML
+
Step 12 Test yourself JSON
+

Resources

Discussion

Share feedback on this tutorial or join the conversation in SAP Community.

Submit detailed feedback Discuss in Community
Steps
Step 1 of 13
1. Create package 2. Create outbound service 3. Create communication scenario in ADT 4. Create communication system in Fiori Launchpad 5. Create communication arrangement 6. Create transformation (XML only) 7. Create ABAP class 8. Implement method 9. Activate code 10. Run class in ABAP Console 11. Test yourself XML 12. Test yourself JSON 13. More information

Learn more →