Docs / Connectors / Google Cloud Pub/Sub

Google Cloud Pub/Sub Connector

The ASAPIO Integration Add-on connects SAP S/4HANA and SAP ECC directly to Google Cloud Pub/Sub, publishing business events in real time using JWT-authenticated REST calls. The connector uses a Google Cloud service account key (P12) stored in the SAP SSF application layer for secure, non-interactive authentication.

Overview

ComponentType
ASAPIO Integration Add-on – FrameworkBase component (required)
ASAPIO Integration Add-on – Connector for Google Cloud Pub/SubAdditional package
PropertyValue
Cloud TypeGOOGLE_PS
ACI Handler Class/ASADEV/CL_ACI_GPUBSUB_HANDLER

Prerequisites

A Google Cloud project with Pub/Sub enabled and a service account with at least the Pub/Sub Publisher role (or a custom role granting pubsub.topics.publish). The SAP application server must have HTTPS connectivity to pubsub.googleapis.com and oauth2.googleapis.com.

Google Cloud Authorization Setup

The connector authenticates using a Google Cloud service account JWT. The service account requires the IAP-secured Web App User role.

Create Service Account and P12 Key

  1. In Google Cloud Console, navigate to IAM & Admin → Service Accounts.
  2. Create a new service account and assign the required roles.
  3. Go to the service account's Keys tab, click Actions → Manage keys, then Add Key → Create new key.
  4. Select P12 format and download the key file. Note the key password (default: notasecret).
Google Cloud service account P12 key creation

SSL Certificate (STRUST)

Google services use certificates issued by GlobalSign. Download the GlobalSign root CA certificate from support.globalsign.com and import it into the SAP SSL trust store.

In transaction STRUST:

  1. Select SSL Client (Anonymous).
  2. Click Import Certificate and select the downloaded GlobalSign certificate.
  3. Click Add to Certificate List and save.
STRUST SSL certificate import for Google

SSF Application Setup

The P12 service account key must be registered as an SSF application in SAP so the connector can use it for JWT signing.

Modern SAP Systems (transaction SSFA)

  1. Open transaction SSFA (or SE16 table SSFAPPLIC to locate the correct application entry).
  2. Select the SSF application entry for the Google connector.
  3. Choose PSE → Import and import the .p12 key file using the P12 key password.
  4. Choose PSE → Save as SSF Application to register it.
SSFA transaction for SSF application setup
P12 import into SSF application

Older SAP Systems

On older SAP systems where SSFA is not available, import using sapgenpse:

sapgenpse import_p12 -p <drive>:usr<SSF_Profile> <key>.p12

SAP Connection Setup (in SAP Gui)

The connection setup in SAP GUI is a required first step for all configuration paths. This creates the RFC destinations, activates the cloud adapter, and registers the connection instance that both Event Studio and SAP GUI-based event configuration rely on.

Step 1 — Create RFC Destinations (SM59)

Create two HTTP type G RFC destinations:

Enable SSL on both RFC destinations using the certificate list where the GlobalSign cert was imported.

SM59 RFC destination for Google OAuth
SM59 RFC destination for Google Pub/Sub

Step 2 — Configure Cloud Adapter (SPRO)

In SPRO → ASAPIO Cloud Integrator → Maintain Cloud Adapter, set:

Google Pub/Sub cloud adapter configuration

Step 3 — Create Connection Instance

In transaction /ASADEV/ACI_SETTINGS, create a connection instance and set the following mandatory default values:

Default AttributeValue / DescriptionRequired
GCP_EMAIL_SERVICEACCT_JWT_ISSService account email address (the JWT issuer)Yes
GCP_TOKEN_DESTINATIONRFC destination name for the OAuth token endpoint (oauth2.googleapis.com)Yes
GCP_SSF_PROFILESSF application name where the P12 key was importedYes
GCP_EXPIRATION_TIME_JWT_EXPJWT expiry time in seconds (max: 3600)Optional
GCP_PERMISSION_JWT_SCOPEOAuth permission scope for the JWT (e.g., https://www.googleapis.com/auth/pubsub)Optional
Google Pub/Sub connection instance default values

Create an outbound interface (Event Studio)

Prerequisite: The connection instance must already be set up in SAP GUI (see SAP Connection Setup above) before Event Studio can be used to configure events.

Event Studio is the recommended web-based interface for creating and managing events. To configure a Google Pub/Sub event:

  1. Open Event Studio and select the backend SAP system.
  2. Go to the Data Catalog to find the data object to stream.
  3. In the Available Standard Events table, click Deploy, or use Create to define a new event.
  4. Select the Google Pub/Sub connection from the Connection dropdown — the Header Fields table auto-populates with the connection's default attributes including GCP_EMAIL_SERVICEACCT_JWT_ISS, GCP_TOKEN_DESTINATION, and GCP_SSF_PROFILE.
  5. Set GOOGLE_TOPIC to the full Pub/Sub topic path.
  6. Save and activate the event.

After creating the interface in Event Studio, see Header Attributes for message configuration and Custom Message Attributes for advanced metadata.

Header Attributes

Configure the following header attribute on the outbound object. Header attributes apply equally when configuring via Event Studio or SAP GUI.

Header AttributeValue / DescriptionRequired
GOOGLE_TOPICFull Pub/Sub topic path: projects/<PROJECT_ID>/topics/<TOPIC_NAME>Yes
Google Pub/Sub header attribute GOOGLE_TOPIC

Create an outbound interface (SAP Gui)

MethodExtraction FMFormatting FM
Simple Notify/ASADEV/ACI_SIMPLE_NOTIFY/ASADEV/ACI_EVNT_FORMATTER_GCP
Message Builder/ASADEV/ACI_GEN_VIEW_EXTRACTOR/ASADEV/ACI_GEN_VIEWFORM_GCP
Packed Load/ASADEV/ACI_GEN_VIEW_EXT_PACK/ASADEV/ACI_GEN_VIEWFORM_GCP

Create Outbound Object

In transaction /ASADEV/68000202, select the connection instance and add an entry under Outbound Objects. Set the method, message type, and Formatting FM as shown above. Set GOOGLE_TOPIC under the Header Attributes tab.

Google Pub/Sub outbound object configuration
Google Pub/Sub outbound object detail

Event Linkage (SWE2)

Register the event trigger in transaction SWE2:

SWE2 event linkage for Google Pub/Sub

Packed Load — Header Attributes

AttributeDescriptionExample
ACI_PACK_TABLETable for key fieldsMARA
ACI_PACK_SIZERecords per delivery package500
ACI_PACK_KEY_LENGTHTotal length of key fields13
ACI_PACK_WHERE_CONDOptional WHERE condition on ACI_PACK_TABLE
ACI_PACK_RETRY_TIMESeconds before retrying server group resource acquisition300
ACI_PACK_BDCP_COMMITGenerate change pointers per entry (~50% performance impact)X

Custom Message Attributes

Available from release 9.32507. Google Pub/Sub supports up to 100 custom message attributes per message. These key-value pairs are visible on every message and can be used by Pub/Sub subscription filters.

Configuration (Field Mapping Section)

In the Field Mapping section of the outbound object, add entries with:

A conversion class/method can be specified to transform raw field values. The resulting attribute values are visible in the ASAPIO monitor when tracing is activated.

Google Pub/Sub custom message attributes configuration