ABAP SDK for Google Cloud — Insider story of Engineering Excellence

Google Cloud recently released ABAP SDK for Google Cloud, providing bi-directional, real-time integration between SAP and Google Cloud services. SAP developers can easily leverage this SDK to integrate their SAP applications with Google Cloud services such as Vertex AI, Document AI, Translation AI, Pub/Sub, and more. With the ABAP SDK, customers can accelerate their digital transformation and achieve business goals faster.

This article aims to provide you with some behind-the-scenes insights into the various engineering excellence initiatives implemented by the Google team during the journey of creating the ABAP SDK for Google Cloud.

The ABAP SDK for Google Cloud is a set of tools and libraries that makes it easy for ABAP developers to build applications that use Google Cloud services. Google developers faced the key challenge of keeping the SDK interface simple enough and uniformly streamlined. The key goal was to enable subconscious programming for ABAP developers to consume the Google Cloud APIs, while hiding the complex underlying features related to connectivity, authentication, error and exception handling, data marshaling, logging etc.

In other words, we wanted to make it easy for ABAP developers to use the SDK without having to worry about the complicated details.

What are Google Cloud APIs and Services

As defined by Google:

Google Cloud APIs allow you to automate your workflows by using your favorite language. Use these Cloud APIs with REST calls or client libraries in popular programming languages. “

Google also provides Enterprise APIs which are High-stability APIs and ready for enterprise use.

API Library is a fantastic resource for learning more about the different API offerings, their capabilities, and pricing details. Google APIs Explorer is a great tool that allows you to experiment with Google APIs without writing any code.

Google Cloud APIs are designed using resource-oriented design principles. At the lowest level, service resources are the fundamental components that make up all Google Cloud services. Examples of service resources include Compute Engine Virtual Machines (VMs), Pub/Sub topics, Cloud Storage buckets, App Engine instances. The API design guide and Resource hierarchy in detail are good source to read for more information.

As a good practice an API should always be coupled with a specification which describes the basic functionality and the expected behavior of the API.

Discovery Documents are used to describe most Google Cloud APIs. Similar to the OpenAPI specification, a Discovery Document is a machine-readable specification for describing and consuming REST APIs.

ABAP SDK for Google cloud provides the API Client stubs(ABAP classes) which are constructed referring to these Discovery Documents. These API client stub for ABAP, act as the first interaction layer for an ABAP developer who wants to call any Google Cloud API. These client stubs will mirror the APIs functionality and make it natively available for ABAP developers to seamlessly consume.

Engineering Excellence aimed to enable subconscious programming

The ABAP SDK was designed by Google developers to simplify the use of Google APIs in SAP and provide a frictionless developer flow for ABAP developers. As a result, when you use the SDK component in your ABAP code, you will experience thoughtful engineering excellence in every part of the SDK.

Here is a bird’s eye view of some of the engineering excellence features built within the SDK to enrich the ABAP developer’s workflow: (You can also read more in this detailed application development guide)

  • API Client Stub: The API Client Stub provides a Single-window of Interaction for ABAP developers. It encapsulates all the operations that a Google Cloud API is capable of performing.
  • Error Code and Exception Handling: The SDK provides clear guidelines on error code and exception handling. This helps you write resilient code that can handle errors gracefully.
  • Implicit Logging: The SDK provides implicit logging with the capability of log object customization for enhanced troubleshooting. This helps you track down and fix problems in your code.
  • Improved Readability and Relatability: The SDK improves readability and relatability for developers for consuming Google Cloud API’s. This makes it easier for you to understand and use the SDK.
    - ABAP Method linkage to API method “ID” using descriptions.
    - Using short names for Class Types linking to API schema id.
    - Class Documentation to provide In-line contextual help while coding using ADT.
  • Pre-built Intelligence for Complex Functionality: The SDK provides pre-built intelligence for complex functionality within API Client Stub. This saves you time and effort when building applications that use Google Cloud services.
  • Pre-bundled Demo Programs: The SDK comes with pre-bundled demo programs that you can use to get started quickly. This helps you learn how to use the SDK and build applications that use Google Cloud services. The Quickstarts also supplement as a good resource to get started.
  • Code Wizard Tool: The SDK provides a code wizard tool that enables code generation capability for SDK users. This significantly improves developer productivity.
  • Multiple Authentication Options: The SDK provides multiple authentication options to enable different SAP landscapes and security requirements. This makes it easy to use the SDK in a variety of SAP environments.
  • Connectivity using RFC destinations: The SDK provides this capability to utilize advanced networking features like proxy server, Private Server Connect, HTTP compression and capability to access region specific API endpoints.
  • Guided Tools for Configuration and Connectivity Validations: The SDK provides guided SPRO tools for configuration and connectivity validations. This helps you get up and running quickly and easily.

API Client Stub Composition and Interaction flow

Google Cloud APIs use JSON for request and response payloads. These APIs can perform a variety of operations(methods) on the resources . The schema for these payloads is well-defined in the APIs discovery document. Making these JSON schemas available to developers in a familiar ABAP format was an interesting challenge to solve. One option was to create corresponding DDIC objects to represent the JSON objects, but this would definitely clutter the object list as we horizontally scale to more APIs being enabled within the SDK. The Single-Window of Interaction guideline mandated us to keep the design lean and relatable. Therefore, keeping all the tightly coupled components within the ABAP client stub helped to continue with the lean design of implementing the API client stubs.

A typical API client stub class consist of the following sections:

  • The ABAP types that map to the API schemas. You use ABAP types to construct an input request and parse the response.
  • The constants and attributes for internal or external usage.
  • The API methods (operations) for interacting with API published resources.
ameyasapcloud_0-1698345606447.png
Class Structure (Original image posted in Google Guides)

As a direct result, the interaction flow for ABAP developers was significantly streamlined, making it possible to program subconsciously while interacting with the SDK.

ameyasapcloud_1-1698345686613.png
Single-window of interaction (Original image posted in Google Guides)

Below is an example of interaction with Pub/Sub API using the 5 pointer interaction flow approach. This flow will be a consistent pattern used for interacting with any Google Cloud API. The SDK provided code wizard tool serves as a helping hand for the developer to generate this templated code.

ameyasapcloud_2-1698345736938.png
Interaction flow (Original image posted in Google Guides)

The API client stubs are also enriched with inline description, which assists in writing code using ADT tools. The ABAP class methods are supplemented with ID which relate to the API’s schema and methods. This helps further streamline the developer flow.

ameyasapcloud_3-1698345770381.gif
Contextual help in ADT to identify the type to be used for PubSub topic creation

Developers can use this linkage to quickly study more about the Google Cloud API method and understand the request and response constructs.

ameyasapcloud_5-1698345944241.png
ABAP method linkage to API method (API Reference)

Next Steps

I hope this article has given you a sneak peek into the coding and engineering capabilities that the SDK has to offer SAP developers. If you are an ABAP developer and you want to try it out, you can follow the installation and configuration guide. The SDK is offered free of charge, but you will be charged for Google API usage. 

  • This blog, explains how you can evaluate ABAP SDK for Google Cloud using ABAP Platform Trial 1909 on Google Cloud Platform.
  • Read this blog post to get a sneak peek on how a business process such as Sales Order entry in SAP can be automated using ABAP SDK for Google Cloud.
  • This blog is an excellent start to understand how BigQuery ML which is a powerful machine learning service that lets you build and deploy models using SQL queries. you can now be accessed with ABAP SDK for Google Cloud.
  • Read this blog post to understand how to use Secret Manager with ABAP SDK.
  • Also check out blog post about ABAP SDK Code Wizard, and on Application logging as some of the many Engineering excellence delivered as part of ABAP SDK.

Happy Learning! and Happy Innovating!

 
 
Version history
Last update:
‎10-26-2023 11:53 AM
Updated by: