Skip to Content
Technical Articles
Author's profile photo Sriprasad S Bhat

OpenConnectors-Amazon S3 Integration made simple with SAP CPI & SAP CP-OCN


In below blog would like to share how we can integrate Amazon S3 and SuccessFactors using SAP CPI & SAP Cloud Platform Open Connectors service.


Lets create simple scenario to pull user dump from SuccessFactors to create file in Amazon S3 Bucket.

Configuration in AWS [ Bucket and Folder Creation ]

Step 1:

Login to your AWS account and Navigate to S3 service.

Step 2:

Create a bucket shown like below following mentioned steps.

Step 3:

Create a folder like below

Configuration in AWS[ IAM service Configuration ]:

Now lets create an user and credentials required to connect AWS S3 bucket from SAP OCN.

Step 1:

Click on Services and navigate to IAM Service.

Step 2:

Navigate to Users and Click on Add User.

If already group is available you can select or else select Create Group.

Now we are all set with AWS Configuration and make sure to copy below credentials which is required for SAP OCN Configuration.

SAP Open Connector Configuration:

Login to SAP Cloud Platform and launch Open Connectors service.Search for Amazon S3 and click on authenticate.

Fill all the required details like below ( API Key,Secret,folder name and Region Endpoint ) and click on Create Instance.

Now you are successfully connected to S3 with below message and click on API Docs.

Click on Post files operation by selecting file that needs to uploaded and folder path inside S3 Bucket.

Navigate to response to copy the credentials and endpoint url to be used in SAP CPI .

SAP CPI Configuration:

Lets create an iflow to pull the data from SuccessFactors and connect to OpenConnectors endpoint url.

Step 1:

Configure Timer Event to initiate the IFlow deployment.

Step 2:

Add Request Reply step with SuccessFactors OData V2 protocol.And configure your channel like below .You can refer below link to make sure it works.

Step 3:

Add Content Modifier and set property to set filename with folder which later can be used in receiver adapter channel.

Step 4:

Add a script to log the payload.Refer below blog for payload logging .

Step 5:

Add XML to CSV converter to generate CSV file.

Step 6:

Add a script to log the payload.Refer below blog for payload logging .

Step 7:

Add Script to set authorization header and set multipart data.Make sure to replace below Auth header with value copied from SAP OCN configuration.

import java.util.HashMap;

def Message setHeader(Message message, String id) {

message.setHeader("authorization", "YOUR AUTH HEADER GOES HERE");
message.setHeader("content-type","multipart/form-data; boundary=--------------------------" + id);

return message;


def ByteArrayOutputStream getMultiPartBody(payload, filename, id) {

String charset = "US-ASCII";
def LINEFEED = "\r\n";

def output = new ByteArrayOutputStream();
output.write(("----------------------------"+ id).getBytes(charset));
output.write(("Content-Disposition: form-data; name=\""+"file"+"\"; filename=\""+filename+"\"").getBytes(charset));

output.write("Content-Type: text/csv".getBytes(charset));

output.write( payload.getBytes(charset));

output.write(("----------------------------"+ id + "--").getBytes(charset));
return output;


def Message processData(Message message) {

String charset = "US-ASCII";
def id = "937427310133901149517591";

def map = message.getProperties();
def filename = "sriprasadtest_1.csv"

def ByteArrayOutputStream output = getMultiPartBody(message.getBody(String.class),filename,id);
message = setHeader(message, id);

return message;

Step 8: 

Add HTTP adapter with below mentioned parameters.

Now you are all good to go with deployment.!


Once you deploy file will be created in Amazon S3 folder.Now time to check for the result!


[ 1 ] – Open Connector Blog series

[ 2 ] –

Hope this helps and Happy Learning!


Sriprasad Shivaram Bhat

Assigned Tags

      You must be Logged on to comment or reply to a post.
      Author's profile photo Bhargav Gogineni
      Bhargav Gogineni

      Thanks for taking time and putting up this well informed blog. Good work Sriprasad.



      Author's profile photo Karthik Bangera
      Karthik Bangera

      Hi Sri,

      Thanks for another very informative write-up. Keep blogging!



      Author's profile photo Anshul Walia
      Anshul Walia

      Thanks for sharing the blog especially in AWS space.

      Author's profile photo Vippin Chhibbar
      Vippin Chhibbar

      Hi Sriprasad,


      Can we use the AWS S3 Open connector to be connected with SAP IBP Data services on Cloud? We have the flat files with some data that are present on AWS S3 storage and we want to consume the data directly in SAP IBP DS cloud.

      Please advise?




      Author's profile photo Tapas Tarun
      Tapas Tarun

      Hello Sriprasad,


      Request to please share some inputs on how to integrate to Amazon S3 Bucket using SAP PO ? Scenario is ECC (Pick .csv File from Al11)  <---> SAP PO <-----> Post the file in Amazon S3 Bucket.


      Tapas Tarun

      Author's profile photo Arsh Gupta
      Arsh Gupta

      HI tapas tarun

      Did you complete the integration? If yes, can you share some reference? Or can you guide me how you proceeded I've the same scenario.


      Author's profile photo Tapas Tarun
      Tapas Tarun

      Dear Arsh,

      Unfortunately, the requirement was put on hold due to costing issue. I guess with CPI and Open Connectors we can achieve this scenario as there are SAP Adaptors available to connect to Amazon S3 as mentioned by various Integration Leads.

      With PI/PO i am still searching on how to achieve this.


      Tapas Tarun




      Author's profile photo Integrations System User
      Integrations System User

      Quick question. What is the significance of id below? That id value is being passed to 2 methods.

      def id = "937427310133901149517591"
      Author's profile photo Jay Malla
      Jay Malla

      Nice blog.



      Author's profile photo Sachin Soni
      Sachin Soni

      Thanks for a very helpful andd informative blog , i was able to make it work !

      Can you show a sample of auth header ? currently i used the three element as in the sample request from open connector page : User,Organization and Element but thats just for one instance how can we automate the instance creation?


      Though you mentioned using the file contents we downloaded from AWS IAM but that seemed to be not working , can you help ?