Technology Blogs by Members
Explore a vibrant mix of technical expertise, industry insights, and tech buzz in member blogs covering SAP products, technology, and events. Get in the mix!
cancel
Showing results for 
Search instead for 
Did you mean: 
Bhavani_Baisani
Participant
894

Connecting to a Cluster Database (RAC) in Suite: A Challenge and Solution

The limitations of direct connections to RAC databases in Suite by leveraging HTTP calls through PI to CPI. This innovative approach provides a flexible and reliable solution for integrating with clustered databases.

Prerequisites:

  • Cluster Database (RAC): Ensure you have a properly configured RAC database instance running.
  • SAP Integration Suite: Have SAP Integration Suite installed and configured.
  • PI (Process Integration): Have PI installed and configured to communicate with your RAC database.
  • CPI (Cloud Platform Integration): Have CPI set up and configured to interact with PI and the RAC database.
  • HTTP Client: You'll need an HTTP client tool (e.g., Postman, curl) to make the necessary HTTP calls.

Process:

Bhavani_Baisani_0-1728747372959.png

IFlow:

Bhavani_Baisani_0-1728740123349.png

Fetch the table data: Content modifier property details

Bhavani_Baisani_1-1728740286569.png

Content Modifier Message Body

Bhavani_Baisani_1-1728747578404.png ${property.Http_Select}

 

Http_Select: REST calls support both JSON and XML, so the HTTP input format for this integration should be XML. The table and query information should be included in the REST input as XML elements.

The SELECT query should be defined in the access element, while the table name should be specified in the action element.

<root>
<stmt>
<TableName action="SQL_QUERY">
<access>Select fieldnames from tablename and rownum = 1</access>
</TableName>
</stmt>
</root>

Http Adapter:

Bhavani_Baisani_2-1728741018442.png

HttpAddress: http://<PIHost>:<PIPort>/RESTAdapter/Call_PI/Send_JDBC

To establish a connection between the Cloud Connector and the on-premises PI system, the following information must be configured:

  • PI Host and Port: These details are essential for the Cloud Connector to locate and communicate with the on-premises PI system.
  • Location ID and PI Credentials: These credentials are required to authenticate and authorize the Cloud Connector's access to the PI system.
  • REST Call Address: The same HTTP address should be used in the REST call within PI to ensure proper communication between the two systems.

Pass through ICO in PI:

Bhavani_Baisani_0-1728743407915.png

REST Call:

Bhavani_Baisani_1-1728743560568.png

Bhavani_Baisani_2-1728743636315.png

Bhavani_Baisani_3-1728743740664.png

Bhavani_Baisani_4-1728743841230.png

JDBC Call: A service-based connection to an Oracle DB running on Oracle RAC (cluster).

Bhavani_Baisani_0-1728746124582.png

Bhavani_Baisani_1-1728746380578.png

Groovy Script: replace root node

To align the structure of the CPI response with the JDBC response.

Bhavani_Baisani_0-1728746683365.png

import com.sap.gateway.ip.core.customdev.util.Message;
import java.util.HashMap;
def Message processData(Message message) {
//Read Input as String
def body = message.getBody(String);

//Replace XML Root and Sub Node
String output = body.replace("root_response", "ROOT").replace("stmt_response", "select_response");

//Set Output
message.setBody(output);
return message;
}

Payload difference before and after groovy

Before groovy:

Bhavani_Baisani_1-1728747019196.png

After groovy:

Bhavani_Baisani_2-1728747087227.png

Following the Groovy script, the integration flow can proceed to the next step based on the script's output and the defined requirements.

NOTE:SAP has recommended the Edge Integration Cell as the ideal solution for this requirement within SAP Integration Suite. However, due to our tight timeline, we're exploring a more immediate option using SAP PO, which already has established connections.

Bhavani.

 

 

 

 

 

 

 

 

1 Comment
Labels in this area