Skip to Content
Technical Articles
Author's profile photo srishti kumari

SAP S/4HANA Integration with SAP Fieldglass via CPI Series-Part 2

Hello everyone,

Warm welcome to my second part of first blog post .Hope you people  have read my first blog post  which explained about the functionality of Fieldglass and how it is useful for the organisation to find, engage and manage their external workforce.

But how all of this is achieved  internally?

I will explain the configurations done on SAP S/4HANA side and SAP CPI side here.


SAP S/4HANA Configurations for Purchase Requisitions,Purchase Orders,Service entry sheets:

Step 1: Go to SAP S/4HANA Cloud tenant and open tile  called Communication arrangements.

Click on NEW and give a name for  Purchase Requisition communication arrangement whose scenario is SAP_COM_0239.


Step 2: Create  a NEW communication system called Fieldglass_SCP with following details:

In host name, mention the  CPI hostname you want to connect to from S4Hana ..

Logical system should be same as what has been maintained for fieldglass.Here,i am using FGSCP

Port should be 443 for CPI..


Step 3: Maintain users for inbound and outbound communication.

Here,i have maintained FIELDGLASS as Communication user for inbound communication with SAP S/4HANA and Cuser i have maintained for outbound communication from SAP S/4HANA along with  the password mentioned.

Fieldglass  Communication user is created using below details.The user name displays on its own and the password is proposed and the user is saved. (same user name and password has to be maintained for CPI user credentials)

Automatically usernames will be populated in SAP_COM_0239_Fieldglass Communication arrangement as shown:


Step 4:The Inbound services will be maintained by the Communication arrangement itself and outbound services of the communication arrangement  will be maintained as follows:

Service URL will automatically come from the hostname and Path has to be given manually corresponding to the path mentioned in SAP CPI Runtime URL starting with cxf.

The communication arrangement is saved .

Step 5:In the same way,we will make communication arrangements for SAP_COM_0238 for Purchase orders processing and SAP_COM_0237 for service entry sheets processing.


Now i will move to CPI based configurations i did for Purchase requisitions,Purchase orders and Service entry sheets processing:

  1. Purchase Requisition flow:

In this flow,Sender is configured as follows:

As some unwanted characters were observed,A groovy script called Decode was written for it:

import java.util.HashMap;
import java.lang.String;

def Message processData(Message message) {

def body = message.getBody(java.lang.String) as String;

body = body.replaceAll(“&lt;”,”<“);
body = body.replaceAll(“&gt;”,”>”);

return message;

In the next content modifier,give properties as shown:

For the xslt mapping,following code was written to deal with the data like controlling area,cost center.Internal order.


Two mappings have been created here:One for Creating a new Purchase Requisition and one for Updating and deleting purchase requisition .So,depending on the value of the router,any one of the mappings is executed.(mapping is expected to done according to your requirements).

The receiver has been configured with SAP S/4HANA Cloud URL along with credentials deployed in security artifacts as shown:


2.PR status iflow:



In content modifier,specify properties as:


The credentials are fetched in the script.Depending on the status of PR as rejected or released ,the particular,fieldglass system is called.Encoder has been used here to do Base64 encoding in the PR status.

3.Purchase Order iflow:


PO iflow will be made same as PR iflow .The credentials of SAP S/4HANA cloud will be maintained at receiver side in security artifacts.

4.Purchase Order status iflow:

Same way PO status iflow will be made.

5.Service entry sheet  replication from Fieldglass to S4Hana Cloud :

6. Service entry sheet status replication from S4Hana Cloud to Fieldglass:

The target  or sender side hosts will be maintained according to your s4hana or fieldglass systems used as the target or sender .The username and password will be deployed in security Material for the above artifacts.

I would like you to give feedback on my blog post.

Thanks for reading. 🙂
















Assigned Tags

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



      Thanks for excellent blog. I have couple of questions

      • If I would like to integrate Fiedlglass with S4 HANA on premise ( not cloud version ), can we use cloud integration gateway or should we also use SAP CPI there as well?
      • Is it possible to integrate fieldglass with old ECC systems?
      • What are the required setup to be done on Fieldglass to integrate it with S4 HANA OP?
      Author's profile photo srishti kumari
      srishti kumari
      Blog Post Author

      Hi Sankara,

      You can use integration gateway for connecting fieldglass to on -premise.


      If you wish to connect fieldglass to old ECC systems,you would have to do the configurations in the ECC system.Business network integration component would have to be installed there.


      I am not much aware of the fieldglass side configuration .For the on premise system,configurations are done in spro transaction if the Business network integration component is installed in the system.On the fieldglass side,we maintain the business system of our s4hana on premise system.




      Author's profile photo Chenxi Gao
      Chenxi Gao

      Hi Srishti,


      Thanks for your sharing, I'm also working on the integration between S4HC and FG refer to best practice 22K which involves integration scenarios for PR, PO, Timesheet and invoice. But after having a look at your instruction, I'm still not clear about what configuration needs to be done on FG side to push the transaction data (e.g. PR or PO when work order gets created or updated). My understanding is there should be some event trigger can help to initiate outbound call to the iFlow. Do you have any reference can be shared with regard to the configuration in FG to trigger the integration flow from FG to S4HC? I previously used different connectors for upload and download via WS call but have no idea about how FG can pro-actively call out external destination.

      Thank you for your help in advance,