SAP Manufacturing Integration and Intelligence (SAP MII) is used to improve your manufacturing processes. SAP PRESS has recently published the book Implementing SAP MII co-authored by Dipankar Saha (Principal Architect – Incture Technologies).
WRITTEN BY
14th June 2022
INTEGRATION
Introduction
Hello
This is my first blog Post where I have been tried to describe a real time scenario of CPI where we have to call the iflow followed by another iflow and spilt the data and fetch it with looping process call. The exception messages will be stored in the data store (with global variable) which will send the receiver the mail also. The receiver also wants to maintain the log id which will be maintained in the Local integration process.
The key to the solution is The Process Direct adapter which can be used to establish communication between integration processes within the same tenant. A Looping Process Call in Cloud Integration that invokes a Local Integration Process iteratively till the conditions are met.
Pre-Requisite:
Fig 1 iflow-1 with Process direct Receiver
Fig 2 iflow-2 with Process direct Receiver
⦁ Details of Adapter and Pallets Configuration
⦁ iFlow-1
Odata Configuration (Fig 3)
Use any free Odata Service here I have used Northwind and select the entities as per your requirement.
Process Direct Receiver Adapter (Fig 4)
Redirect to the address given in sender iflow sender adapter (Process direct).
Logger Script
Logger Script is here to check the Logs which we can check from the monitoring page.
import com.sap.gateway.ip.core.customdev.util.Message;
import java.util.HashMap;
def Message processData(Message message)
{
def body = message.getBody(java.lang.String) as String;
def messageLog = messageLogFactory.getMessageLog(message);
if(messageLog != null)
{
messageLog.setStringProperty("log1","Printing Payload As Attachment")
messageLog.addAttachmentAsString("log1",body,"text/plain");
}
return message;
}
Exception Sub Process (Fig 6)
If the iflow has some error then it will go to data store through exception sub process and we can check there by fetching the data from a different iflow as we have set the Global Variable in Write variable option.
Content Modifier
Set the message in message Body to send the receiver.
Deployment (Fig 8)
After deployment the mail received as follows.
Conclusion
This blog will help you to connect two different iflow via Process direct and help to store the exception data in the data store which explain the use of Write variable and write operation. The process call also check the logs in the monitoring page by logger script.
Please like the blog post if you find the information useful. Also, please leave your thoughts and opinions in the comments section.
Good luck with your studies!…
References
1]https://blogs.sap.com/2020/01/09/sap-cloud-platform-integration-cpi-part-7-maintaining-logs-using-groovy-scripts-even-if-the-iflow-is-not-on-trace-mode./
2]https://blogs.sap.com/2021/09/16/sap-cloud-integration-cpi-hci-writing-groovy-scripts-_-with-basic-examples/
3]https://blogs.sap.com/2020/01/23/sap-cloud-platform-integration-cpi-part-11-how-to-use-a-local-integration-process/
SAP Manufacturing Integration and Intelligence (SAP MII) is used to improve your manufacturing processes. SAP PRESS has recently published the book Implementing SAP MII co-authored by Dipankar Saha (Principal Architect – Incture Technologies).
This is my first blog post and I will be guiding you on how we can build a connection and interchange messages between Company and our Trading Partners using Trading Partner Management capability which is recently added in SAP Integration suite.