SAP ERP

The SAP ERP connector lets you perform insert, delete, update, and read operations on SAP ERP data.

Before you begin

Before using the SAP ERP connector, do the following tasks:

  • In your Google Cloud project:
    • Grant the roles/connectors.admin IAM role to the user configuring the connector.
    • Grant the following IAM roles to the service account that you want to use for the connector:
      • roles/secretmanager.viewer
      • roles/secretmanager.secretAccessor
      • roles/storage.objectViewer

      A service account is a special type of Google account intended to represent a non-human user that needs to authenticate and be authorized to access data in Google APIs. If you don't have a service account, you must create a service account. For more information, see Creating a service account.

    • Enable the following services:
      • secretmanager.googleapis.com (Secret Manager API)
      • connectors.googleapis.com (Connectors API)

      To understand how to enable services, see Enabling services.

    If these services or permissions have not been enabled for your project previously, you are prompted to enable them when configuring the connector.

Configure the connector

Configuring the connector requires you to create a connection to your data source (backend system). A connection is specific to a data source. It means that if you have many data sources, you must create a separate connection for each data source. To create a connection, do the following steps:

  1. In the Cloud console, go to the Integration Connectors > Connections page and then select or create a Google Cloud project.

    Go to the Connections page

  2. Click + Create new to open the Create Connection page.
  3. In the Location section, choose the location for the connection.
    1. Region: Select a location from the drop-down list.

      For the list of all the supported regions, see Locations.

    2. Click Next.
  4. In the Connection Details section, complete the following:
    1. Connector: Select SAP ERP from the drop down list of available Connectors.
    2. Connector version: Select the Connector version from the drop down list of available versions.
    3. In the Connection Name field, enter a name for the Connection instance.

      Connection names must meet the following criteria:

      • Connection names can use letters, numbers, or hyphens.
      • Letters must be lower-case.
      • Connection names must begin with a letter and end with a letter or number.
      • Connection names cannot exceed 63 characters.
    4. Optionally, enter a Description for the connection instance.
    5. Service Account: Select a service account that has the required roles.
    6. Client: The client authenticating to the SAP system.
    7. System Id: The System Id or R3Name of the SAP System is a string with a maximum of three characters. It is often used in load balancing connections.
    8. System Number: The number by which the target system is defined. Used when setting the Host connection property.
    9. Project ID: The ID of the Google Cloud project where the GCS bucket containing the SAP JCo jar resides.
    10. Bucket: The name of the bucket containing sapjco3.jar and libsapjco3.so files.
    11. Jaco jar object ID: Object ID of the JCo jar.
    12. libsapjco3 object ID: Object ID of the libsapjco3 jar.
    13. Table mode: Select the SAP table to be displayed as a view.
    14. SNC_LIB object ID: Object ID of the SNC library.
    15. PSE name: Name of the Personal Security Environment (PSE) file that is applicable for the bucket. A PSE file stores the public and private key pair as well as X.509 certificates in a ASN.1 structure.
    16. Group: The group name for logon. This is normally specified when your SAP system uses load balancers.
    17. Message server: Name of the message server to be used when connecting to the SAP system that uses load balancers.
    18. Read table function: Name of the function to be used for reading tables. For more information, see Use a custom read table function.
    19. Connection scheme: Select a connection scheme to be used for connecting to your SAP system.
    20. System ID: The system ID or the R3Name of the SAP system. You can enter a maximum of 3 characters.
    21. SNC passcode: Select the Secret Manager secret of the SNC library passcode.
    22. Secret version: Select the secret version.
    23. SNC mode: Select this option to enable SNC for authentication between Integration Connectors and your SAP system.
    24. SNC name: Enter a name for SNC connection.
    25. SNC qop: Select a protection level. The following are the supported levels:
      • 1 - Apply authentication only.
      • 2 - Apply integrity protection. This also includes authentication protection.
      • 3 - Apply privacy protection. This also includes integrity and authentication protection.
      • 8 - Apply the default protection.
      • 9 - Apply the maximum protection.
    26. SNC partner name: Enter the application server's SNC name.
    27. Query mode: Select which SAP tables should be displayed as views.
    28. Browsable views: Enter a comma separated list of views to be displayed. For example, ViewA,ViewB,ViewC.
    29. Verbosity level: Enter the verbosity level for logging. The supported values are from 1 to 5. A higher value means that more details will be available in the logs.
    30. Optionally, configure the Connection node settings:

      • Minimum number of nodes: Enter the minimum number of connection nodes.
      • Maximum number of nodes: Enter the maximum number of connection nodes.

      A node is a unit (or replica) of a connection that processes transactions. More nodes are required to process more transactions for a connection and conversely, fewer nodes are required to process fewer transactions. To understand how the nodes affect your connector pricing, see Pricing for connection nodes. If you don't enter any values, by default the minimum nodes are set to 2 (for better availability) and the maximum nodes are set to 50.

    31. Optionally, click + ADD LABEL to add a label to the Connection in the form of a key/value pair.
    32. Click Next.
  5. In the Destinations section, enter details of the remote host (backend system) you want to connect to.
    1. Destination Type: Select a Destination Type.
      1. In the Host address field, specify the hostname or IP address of the destination.
        1. If you want to establish a private connection to your backend systems, follow these steps:
          1. Create a PSC service attachment.
          2. Create an endpoint attachment and then enter the details of the endpoint attachment in the Host address field.
        2. If you want to establish a public connection to your backend systems with additional security, you can consider configuring static outbound IP addresses for your connections, and then configure your firewall rules to allowlist only the specific static IP addresses.

      To enter additional destinations, click +Add destination.

    2. Click Next.
  6. In the Authentication section, enter the authentication details.
    1. Select an Authentication type and enter the relevant details.

      The following authentication types are supported by the SAP ERP connection:

      • Username and password
    2. To understand how to configure these authentication types, see Configure authentication.

    3. Click Next.
  7. Review: Review your connection and authentication details.
  8. Click Create.

Configure authentication

Enter the details based on the authentication you want to use.

  • Username and password
    • Username: Username for connector
    • Password: Secret Manager Secret containing the password associated with the connector.

Use a custom read table function

RFC_READ_TABLE

The connector uses the SAP RFC_READ_TABLE function to get data from SAP tables.

However, it has certain limitations. As an example, consider the DATA_BUFFER_EXCEEDED exception. The SAP RFC_READ_TABLE has a fixed size of 512 bytes. It can buffer for each row of data, and thus you cannot select more columns than the amount that would fit in this buffer. If you select more than 512 bytes, an exception will occur indicating that you have exceeded the maximum buffer size allowed per row and need to select fewer columns.

RFC_READ_TABLE2

The connector also supports the RFC_READ_TABLE2 table read function. You can switch the active table read function to RFC_READ_TABLE2 by setting ReadTableFunction to /SAPDS/RFC_READ_TABLE2.

Custom Read Table Functions

Install a Custom Read Table RFC

The connector includes the code for Z_CUSTOM_READ_TABLE, a custom read-table RFC that is similar to the SAP RFC_READ_TABLE, but with a larger buffer to address the DATA_BUFFER_EXCEEDED problem as well as bypass other RFC_READ_TABLE limitations.

The following steps show how to use the included custom read-table RFC to bypass limitations with the default RFC_READ_TABLE.

  1. Use the RFC_READ_TABLE function as a template for the new function: Select transaction code SE37 and the SDTX Function Group and copy RFC_READ_TABLE to a new function group or your working function group. In this example, RFC_READ_TABLE is copied to Z_CUSTOM_READ_TABLE.
  2. On the Attributes tab of the SAP screen, select Remote Enabled Module.
  3. On the Tables tab, set the DATA parameter to CHAR8000 (you may need to right-click and then click Display -> Change)
  4. On the Source Code tab, paste the example source code for the replacement RFC_READ_TABLE function module located in the db subfolder of the installation directory. The code is located in Z_CUSTOM_READ_TABLE.txt, though Z_CUSTOM_READ_TABLE_752.txt is preferred if your SAP ERP instance is running ABAP version 7.52 or later (see section below). Click Save.
  5. Define the imports, tables, and exceptions as documented in the provided custom read table.
  6. Activate the function module and in your connection string set ReadTableFunction to Z_CUSTOM_READ_TABLE, or the name of your function module.

The ABAP 7.52 Custom Read Table

Along with Z_CUSTOM_READ_TABLE.txt, there is also a Z_CUSTOM_READ_TABLE_752.txt file, designed for ABAP version 7.52 and above. It is mostly the same as Z_CUSTOM_READ_TABLE, but it takes advantage of newly available keywords in ABAP 7.52 to perform paging within the database instead of in the ABAP script itself. This makes paging efficient when working with large tables.

It is recommended to use the Z_CUSTOM_READ_TABLE_752 RFC if at all possible.

Entities, operations, and actions

All the Integration Connectors provide a layer of abstraction for the objects of the connected application. You can access an application's objects only through this abstraction. The abstraction is exposed to you as entities, operations, and actions.

  • Entity: An entity can be thought of as an object, or a collection of properties, in the connected application or service. The definition of an entity differs from a connector to a connector. For example, in a database connector, tables are the entities, in a file server connector, folders are the entities, and in a messaging system connector, queues are the entities.

    However, it is possible that a connector doesn't support or have any entities, in which case the Entities list will be empty.

  • Operation: An operation is the activity that you can perform on an entity. You can perform any of the following operations on an entity:

    Selecting an entity from the available list, generates a list of operations available for the entity. For a detailed description of the operations, see the Connectors task's entity operations. However, if a connector doesn't support any of the entity operations, such unsupported operations aren't listed in the Operations list.

  • Action: An action is a first class function that is made available to the integration through the connector interface. An action lets you make changes to an entity or entities, and vary from connector to connector. However, it is possible that a connector doesn't support any action, in which case the Actions list will be empty.

System limitations

The SAP ERP connector can process 7 transactions per second, per node, and throttles any transactions beyond this limit. By default, Integration Connectors allocates 2 nodes (for better availability) for a connection.

For information on the limits applicable to Integration Connectors, see Limits.

Connection configuration samples

This section lists the sample values for the various fields that you would configure when creating the connection.

ApplicationServer connection type

The following table lists the sample configuration values for the ApplicationServer connection type. Refer to the connection creation interface in the console to know the mandatory and optional fields.

Field name Sample value
Region us-central1
Connector SAP ERP
Connector Version 1
Connector Name saperp-applicationserver-conn
Description NA
Service Account xxxxxxxxx-compute@developer.gserviceaccount.com
Client 800
System Number 00
Project ID xxxx-gcp-project
Bucket sap-erp-bucket
Jco Jar object ID sapjco3.jar
libsapjco3 object ID libsapjco3.so
Table Mode TransparentApplication/TransparentCustomer/TransparentSystem/Pooled/Cluster/None
Read Table Function Z_CUSTOM_READ_TABLE
Connection Scheme ApplicationServer
System Id SA1
Query Mode NA
Browsable Views NA
Verbosity Level 5
Minimum number of nodes 2
Maximum number of nodes 50
Host Address 10.30.X.XX or Router string of an external SAP system.
Authentication User Password
Username 12345
Password xyz@12345
versions 1

GroupServer connection type

The following table lists the sample configuration values for the GroupServer connection type. Refer to the connection creation interface in the console to know the mandatory and optional fields.

Field name Sample value
Region us-central1
Connector SAP ERP
Connector Version 1
Connector Name saperp-GroupServer-conn
Description NA
Service Account xxxxxxxxx-compute@developer.gserviceaccount.com
Client 800
System Number 00
Project ID xxxx-gcp-project
Bucket sap-erp-bucket
Jco Jar object ID sapjco3.jar
libsapjco3 object ID libsapjco3.so
Table Mode TransparentApplication/TransparentCustomer/TransparentSystem/Pooled/Cluster/None
Group PUBLIC
Message Server 10.30.X.XX
Read Table Function Z_CUSTOM_READ_TABLE
Connection Scheme GroupServer
System Id SA1
Query Mode NA
Browsable Views NA
Verbosity Level 5
Minimum number of nodes 2
Maximum number of nodes 50
Host Address 10.30.X.XX or Router String of External SAP System.
Authentication User Password
Username 12345
Password xyz@12345
versions 1

X509 certificate connection type

The following table lists the sample configuration values for the X509 certificate connection type. Refer to the connection creation interface in the console to know the mandatory and optional fields.

Field name Sample value
Region us-central1
Connector SAP ERP
Connector Version 1
Connector Name saperp-X509Certificate-conn
Description NA
Service Account xxxxxxxxx-compute@developer.gserviceaccount.com
Client 800
System Number 00
Project ID xxxx-gcp-project
Bucket sap-erp-bucket
Jco Jar object ID sapjco3.jar
libsapjco3 object ID libsapjco3.so
Table Mode TransparentApplication/TransparentCustomer/TransparentSystem/Pooled/Cluster/None
SNC_LIB object ID libsapcrypto.so
PSE Name to create cred_v2 file EHP8_GCP_SA1.pse
Read Table Function Z_CUSTOM_READ_TABLE
Connection Scheme ApplicationServer
System Id SA1
SNC passcode xyz@gcp
SNC Mode A boolean determining if you are using SNC. Set this to true to use SNC.
SNC Name p:CN=EHP8_GCP_SA1, OU=IT, O=CSW, C=DE
SNC Qop 3
SNC PartnerName p:CN=SA1, OU=I0020070395, OU=SAP Web AS, O=SAP Trust Community, C=DE
Query Mode NA
Browsable Views NA
Verbosity Level 5
Minimum number of nodes 2
Maximum number of nodes 50
Host Address 10.30.X.XX or Router String of External SAP System.
Authentication X509Certificate Based Authentication
X509Certificate The X509 certificate may be specified using a file path pointing to a file containing an X509 certificate in PEM format, a PEM blob beginning with the "-----BEGIN ..." header, or a PEM blob without the "-----BEGIN ..." header.
versions 1

Actions

This section lists the actions supported by the connector. To understand how to configure the actions, see Action examples.

BAPI_MATERIAL_SAVEDATA action

This action let you perform specific tasks. For example, you can use it to create or change material master data in SAP ERP.

Input parameters of the BAPI_MATERIAL_SAVEDATA action

Parameter Name Data Type Required Description
HEADDATA String Yes The input parameter HEADDATA.
CLIENTDATA String Yes The input parameter CLIENTDATA.
CLIENTDATAX String Yes The input parameter CLIENTDATAX.
MATERIALDESCRIPTION String Yes The table MATERIALDESCRIPTION.

Output parameters of the BAPI_MATERIAL_SAVEDATA action

This action returns the status 200 (OK) if the action is successful.

For example on how to configure the BAPI_MATERIAL_SAVEDATA action, see Action examples.

ZFM_GCP_MULTIDATA_TAB action

This action let users perform specific tasks. For example, you can create multi datatype data in SAP ERP.

Input parameters of the ZFM_GCP_MULTIDATA_TAB action

Parameter Name Data Type Required Description
ReturnTables String Yes A comma separated list that specifies which tables in the function module should be output. If not specified, all returned tables will be output.
T_TABLE String Yes The table T_TABLE.
IM_INPUT_1 String Yes The input parameter IM_INPUT_1.
IM_INPUT_2 String Yes The input parameter IM_INPUT_2.

Output parameters of the ZFM_GCP_MULTIDATA_TAB action

This action returns the status 200 (OK) if the action is successful.

For example on how to configure the ZFM_GCP_MULTIDATA_TAB action, see Action examples.

PushIDoc Action

This action let you perform specific tasks. For example, you can transfer data from SAP to an external system.

Input parameters of the PushIDoc action

Parameter Name Data Type Required Description
FileType String Yes The file type.The allowed values are XML, IDoc.
Mode String Yes The transfer mode.The allowed values are Sync, ASync.
Content String Yes Content of the file.

Output parameters of the PushIDoc action

This action returns the status 200 (OK) if the action is successful.

For example on how to configure the PushIDoc action, see Action examples.

ExecuteCustomQuery action

This action lets you execute a custom query.

To create a custom query, follow these steps:

  1. Follow the detailed instructions to add a connectors task.
  2. When you configure the connector task, in the type of action you want to perform, select Actions.
  3. In the Action list, select Execute custom query, and then click Done.
  4. Expand the Task input section, and then do the following:
    1. In the Timeout after field, enter the number of seconds to wait till the query executes.

      Default value: 180 seconds.

    2. In the Maximum number of rows field, enter the maximum number of rows to be returned from the database.

      Default value: 25.

    3. To update the custom query, click Edit Custom Query. The Script editor dialog opens.
    4. In the Script editor dialog, enter the SQL query and click Save.

      You can use a question mark (?) in a SQL statement to represent a single parameter that must be specified in the query parameters list. For example, the following SQL query selects all rows from the Employees table that matches the values specified for the LastName column:

      SELECT * FROM Employees where LastName=?

    5. If you've used question marks in your SQL query, you must add the parameter by clicking + Add Parameter Name for each question mark. While executing the integration, these parameters replace the question marks (?) in the SQL query sequentially. For example, if you have added three question marks (?), then you must add three parameters in order of sequence. To add query parameters, do the following:
      1. From the Type list, select the data type of the parameter.
      2. In the Value field, enter the value of the parameter.
      3. To add multiple parameters, click + Add Query Parameter.

On successful execution, this action returns the status 200 (OK) with a response body that has the query results.

Action examples

Example - Create a record

This example creates a metrial record by using the BAPI_MATERIAL_SAVEDATA action.

  1. In the Configure connector task dialog, click Actions.
  2. Select the BAPI_MATERIAL_SAVEDATA action, and then click Done.
  3. In the Task Input section of the Connectors task, click connectorInputPayload and then enter a value similar to the following in the Default Value field:
    {
    "HEADDATA": "{\"MATERIAL\":\"000000000000009001\",\"IND_SECTOR\":\"M\",\"MATL_TYPE\":\"HALB\",\"BASIC_VIEW\":\"X\"}",
    "CLIENTDATA" : "{\"MATL_GROUP\":\"00107\",\"BASE_UOM\":\"KG\"}",
    "CLIENTDATAX" : "{\"MATL_GROUP\":\"X\",\"BASE_UOM\":\"X\"}",
    "MATERIALDESCRIPTION" : "{\"LANGU\":\"E\",\"MATL_DESC\":\"Classification Google\"}"
    }
  4. If the action is successful, the BAPI_MATERIAL_SAVEDATA task's connectorOutputPayload response parameter will have a value similar to the following:

    [{
    "RETURN_TYPE": "S",
    "RETURN_ID": "MM",
    "RETURN_NUMBER": 356,
    "RETURN_MESSAGE": "The material 9001 has been created or extended",
    "RETURN_LOG_NO": "",
    "RETURN_LOG_MSG_NO": 0,
    "RETURN_MESSAGE_V1": "9001",
    "RETURN_FIELD": "",
    "RETURN_SYSTEM": "T90CLNT090",
    "RESULT_TABLE": null
    }]

Example - Update a record

This example updates a metrial record by using the BAPI_MATERIAL_SAVEDATA action.

  1. In the Configure connector task dialog, click Actions.
  2. Select the BAPI_MATERIAL_SAVEDATA action, and then click Done.
  3. In the Task Input section of the Connectors task, click connectorInputPayload and then enter a value similar to the following in the Default Value field:
    {
    "HEADDATA": "{\"MATERIAL\":\"000000000000009000\",\"IND_SECTOR\":\"A\",\"MATL_TYPE\":\"FHMI\",\"BASIC_VIEW\":\"X\"}",
    "CLIENTDATA": "{\"MATL_GROUP\":\"013\",\"BASE_UOM\":\"ST\"}",
    "CLIENTDATAX": "{\"MATL_GROUP\":\"X\",\"BASE_UOM\":\"X\"}",
    "MATERIALDESCRIPTION": "{\"LANGU\":\"E\",\"MATL_DESC\":\"Classification Googlecloud\"}"
    }
  4. If the action is successful, the BAPI_MATERIAL_SAVEDATA task's connectorOutputPayload response parameter will have a value similar to the following:

    [{
    "RETURN_TYPE": "S",
    "RETURN_ID": "MM",
    "RETURN_NUMBER": 356,
    "RETURN_MESSAGE": "The material 9000 has been created or extended",
    "RETURN_LOG_NO": "",
    "RETURN_LOG_MSG_NO": 0,
    "RETURN_MESSAGE_V1": "9000",
    "RETURN_PARAMETER": "",
    "RETURN_ROW": 0,
    "RETURN_FIELD": "",
    "RETURN_SYSTEM": "T90CLNT090",
    "RESULT_TABLE": null
    }]

Example - Delete a record

This example deletes a metrial record by using the BAPI_MATERIAL_SAVEDATA action.

  1. In the Configure connector task dialog, click Actions.
  2. Select the BAPI_MATERIAL_SAVEDATA action, and then click Done.
  3. In the Task Input section of the Connectors task, click connectorInputPayload and then enter a value similar to the following in the Default Value field:
    {
    "HEADDATA": "{\"MATERIAL\":\"000000000000009000\",\"BASIC_VIEW\":\"X\"}",
    "CLIENTDATA": "{\"DEL_FLAG\":\"X\"}",
    "CLIENTDATAX": "{\"DEL_FLAG\":\"X\"}"
    }
  4. If the action is successful, the BAPI_MATERIAL_SAVEDATA task's connectorOutputPayload response parameter will have a value similar to the following:

    [{
    "RETURN_TYPE": "S",
    "RETURN_ID": "MM",
    "RETURN_NUMBER": 356,
    "RETURN_LOG_NO": "",
    "RETURN_LOG_MSG_NO": 0,
    "RETURN_MESSAGE_V1": "9000",
    "RETURN_PARAMETER": "",
    "RETURN_ROW": 0,
    "RETURN_FIELD": "",
    "RETURN_SYSTEM": "T90CLNT090",
    "RESULT_TABLE": null
    }]
    

Example - Create multidata type data

This example creates multidata type data by using the ZFM_GCP_MULTIDATA_TAB action.

  1. In the Configure connector task dialog, click Actions.
  2. Select the ZFM_GCP_MULTIDATA_TAB action, and then click Done.
  3. In the Task Input section of the Connectors task, click connectorInputPayload and then enter a value similar to the following in the Default Value field:
    {
    "T_TABLE": "{\"ZACCP\":\"111\",\"ZCHAR\":\"CHARACTER1\",\"ZCLNT\":\"100\",\"ZCUKY\":\"INR\",\"ZCURR\": 200,\"ZDATS\": \"20231213\",\"ZINT1\": 45,\"ZINT2\":54,\"ZDEC\": 0.12,\"ZFLTP\": 1234,\"ZLANG\":\"E\",\"ZNUMC\":\"110\",\"ZPREC\": 3,\"ZQUAN\": 188.0,\"ZRAW\":\"01010008010101050401\",\"ZTIMS\": \"103056\",\"ZUNIT\":\"11\",\"ZINT4P\": 45,\"ZINT4\": 54,\"ZLRAW\":\"0101000801010105040100030101010300040000\"}",
    "IM_INPUT_1": "{\"ZACCP\":\"222\",\"ZCHAR\":\"CHARACTER1\",\"ZCLNT\":\"100\",\"ZCUKY\":\"INR\",\"ZCURR\": 200,\"ZDATS\": \"20231213\",\"ZINT1\": 45,\"ZINT2\":54,\"ZDEC\": 0.12,\"ZFLTP\": 1234,\"ZLANG\":\"E\",\"ZNUMC\":\"110\",\"ZPREC\": 3,\"ZQUAN\": 188.0,\"ZRAW\":\"01010008010101050401\",\"ZTIMS\": \"103056\",\"ZUNIT\":\"11\",\"ZINT4P\": 45,\"ZINT4\": 54,\"ZLRAW\":\"0101000801010105040100030101010300040000\"}",
    "IM_INPUT_2": "{\"ZSTRING\": \"HI Google\",\"ZSSTRING\": \"HI Google How are you\"}"
    }
  4. If the action is successful, the ZFM_GCP_MULTIDATA_TAB task's connectorOutputPayload response parameter will have a value similar to the following:

    [{
    "EX_OUTPUT_1_ZACCP": 222,
    "EX_OUTPUT_1_ZCHAR": "CHARACTER1",
    "EX_OUTPUT_1_ZCLNT": "100",
    "EX_OUTPUT_1_ZCUKY": "INR",
    "EX_OUTPUT_1_ZCURR": 200,
    "EX_OUTPUT_1_ZDATS": "2023-12-13",
    "EX_OUTPUT_1_ZRAW": "01010008010101050401",
    "EX_OUTPUT_1_ZTIMS": "10:30:56",
    "EX_OUTPUT_1_ZUNIT": "11",
    "EX_OUTPUT_1_ZINT4P": 45,
    "EX_OUTPUT_1_ZINT4": 54,
    "EX_OUTPUT_1_ZLRAW": "0101000801010105040100030101010300040000\u0000",
    "EX_OUTPUT_2_ZSTRING": null,
    "EX_OUTPUT_2_ZSSTRING": null,
    "RESULT_TABLE": null,
    "T_TABLE_ZACCP": null,
    "T_TABLE_ZCHAR": null,
    "T_TABLE_ZCLNT": null,
    "T_TABLE_ZQUAN": null,
    "T_TABLE_ZRAW": null,
    "T_TABLE_ZTIMS": null,
    "T_TABLE_ZUNIT": null
    },{
    "EX_OUTPUT_1_ZACCP": null,
    "EX_OUTPUT_1_ZCHAR": null,
    "EX_OUTPUT_1_ZCLNT": null,
    "EX_OUTPUT_1_ZCUKY": null,
    "EX_OUTPUT_1_ZRAW": null,
    "T_TABLE_ZLANG": null,
    "T_TABLE_ZNUMC": null,
    "T_TABLE_ZPREC": null,
    "T_TABLE_ZQUAN": null,
    "T_TABLE_ZRAW": null,
    "T_TABLE_ZTIMS": null,
    "T_TABLE_ZUNIT": null
    },{
    "EX_OUTPUT_1_ZACCP": null,
    "EX_OUTPUT_1_ZCHAR": null,
    "EX_OUTPUT_1_ZCLNT": null,
    "EX_OUTPUT_1_ZCUKY": null,
    "EX_OUTPUT_1_ZCURR": null,
    "EX_OUTPUT_1_ZDATS": null,
    "EX_OUTPUT_1_ZDEC": null,
    "EX_OUTPUT_1_ZQUAN": null,
    "T_TABLE_ZNUMC": 110,
    "T_TABLE_ZPREC": 3,
    "T_TABLE_ZQUAN": 188,
    "T_TABLE_ZRAW": "01010008010101050401",
    "T_TABLE_ZTIMS": "10:30:56",
    "T_TABLE_ZUNIT": "11"
    }]
    

Example - Push an IDoc

This example pushes an IDoc to the SAP ERP.

  1. In the Configure connector task dialog, click Actions.
  2. Select the PushIDoc action, and then click Done.
  3. In the Task Input section of the Connectors task, click connectorInputPayload and then enter a value similar to the following in the Default Value field:
    {
    "Content": "\n\n\n EDI_DC40\n 800\n 0000000008604824\n 740\n 53\n 2\n \n MATMAS05\n MATMAS\n ZLS_QA23\n LS\n ZLS_QA23\n SAPSA1\n LS\n SA1CLNT800\n 20230218\n 232556\n\n\n 005\n 000000000000000012\n 20170328\n 42039\n 20170727\n 42039\n KLVC\n FERT\n M\n 02\n BG\n 000\n 002\n 0.000\n 0.000\n KGM\n 0.000\n 0001\n 0.000\n 0.000\n 0.000\n 0.000\n 0.000\n",
    "FileType": "XML",
    "Mode": "ASync"
    }
  4. . If the action is successful, the PushIDoc task's connectorOutputPayload response parameter will have a value similar to the following:

    [{
    "Result": "Success",
    "Message": "Push IDoc success"
    }]

Entity operation examples

This section shows how to perform some of the entity operations in this connector.

Example - List all the records

This example lists all the records in the T001 entity.

  1. In the Configure connector task dialog, click Entities.
  2. Select T001 from the Entity list.
  3. Select the List operation, and then click Done.
  4. Optionally, in Task Input section of the Connectors task, you can filter your result set by specifying a filter clause. Specify the filter clause value always within the single quotes (').

Example - Get a record from an entity

This example gets a record with the specified ID from the T001 entity.

  1. In the Configure connector task dialog, click Entities.
  2. Select T001 from the Entity list.
  3. Select the Get operation, and then click Done.
  4. In the Task Input section of the Connectors task, click EntityId and then enter 0001 in the Default Value field.

    Here, 0001 is a unique record ID in the T001 entity.

Use terraform to create connections

You can use the Terraform resource to create a new connection.

To learn how to apply or remove a Terraform configuration, see Basic Terraform commands.

To view a sample terraform template for connection creation, see sample template.

When creating this connection by using Terraform, you must set the following variables in your Terraform configuration file:

Parameter name Data type Required Description
client STRING True The client authenticating to the SAP system.
group STRING False The Logon Group being used. This typically only needs to be specified when connecting to an SAP system that uses load balancing.
message_server STRING False The message server must be specified when connecting to an SAP system that uses load balancing.
read_table_function STRING False The function to use for reading table data.
connection_scheme ENUM False Specifies whether you are connecting to a SAP system with a message server (GroupServer) or without one (ApplicationServer). Supported values are: ApplicationServer, GroupServer
system_id STRING False The System Id or R3Name of the SAP System is a string with a maximum of three characters. It is often used in load balancing connections.
system_number STRING True The number by which the target system is defined. Used when setting the Host connection property.
project_id STRING True The ID of the Google Cloud project where the Cloud Storage bucket containing the SAP JCo jar resides.
bucket STRING True The name of the bucket containing sapjco3.jar and libsapjco3.so files
sapjco3_jar STRING True The object id for sapjco3.jar
libsapjco3_so STRING True The object id for libsapjco3.so
snc_lib STRING False The object id for SNC library
snc_mode BOOLEAN False A boolean determining if you are using SNC. Set this to true to use SNC.
snc_name STRING False An optional input with the name of your SNC connection.
snc_qop ENUM False The quality of protection for your SNC connection.Valid values are 1, 2, 3, 8, or 9, which correspond to the following protection levels: 1 Apply authentication only. 2 Apply integrity protection (authentication). 3 Apply privacy protection (integrity and authentication). 8 Apply the default protection. 9 Apply the maximum protection. Supported values are: 1, 2, 3, 8, 9
snc_partner_name STRING False The application server's SNC name. This is a required input when using SNC.
query_mode ENUM False Determines which SAP tables will be displayed as views if any. Supported values are: Global, Local, All, None
table_mode ENUM False Determines which SAP tables will be displayed as views if any. Supported values are: TransparentApplication, TransparentCustomer, TransparentSystem, Pooled, Cluster, All, None
verbosity STRING False Verbosity level for connection, varies from 1-5. Higher verbosity level will log all the communication details (request,response & ssl certificates).

Use the SAP ERP connection in an integration

After you create the connection, it becomes available in both Apigee Integration and Application Integration. You can use the connection in an integration through the Connectors task.

  • To understand how to create and use the Connectors task in Apigee Integration, see Connectors task.
  • To understand how to create and use the Connectors task in Application Integration, see Connectors task.

Get help from the Google Cloud community

You can post your questions and discuss this connector in the Google Cloud community at Cloud Forums.

What's next