BTP Integration – Process email Attachment to Post Deep insert using odata on Premise ECC
There are different integration scenarios where we would like send to an email with attachment of contents (XML or json) which can be read and sent to ECC to post a transaction identified by the integration. To achieve this we have to perform the following Steps
- Configure ECC and cloud connector for http
- check connectivity for IMAP download and import the certificates into Integration Suite key Store
- Create the BTP Integration iflow to process inbound email to read the attachment and invoke the configured odata service and send result email or exception process email
- Test the end to end process
We describe in detail each of these in derail
- Configure cloud connector for the on Premise ECC system as shown below ( cloud to on Premise or your subaccount ) Make sure the connection works
- Check in Integration suite Operations View Connectivity test for IMAP for the email provider as shown below – I have created a folder CPI in my yahoo account to which I will move the emails with attachments of XML odata to create deep insert for Sales Order Download the Certificates and import all the certificate files into the key store in the Operations View.
- Create the iflow which will read the inbound email with attachment – Using the groovy script read the attachment and transfer to message body (XM). The odata service have chosen for this blog is http://s4h2:80001/sap/opu/odata/IWBEP/GWSAMPLE_BASIC/SalesOrderSet. This involves a deep insert consisting of Sales Order header and items. The Iflow consists of main process and exception sub process the result sent to email as shown below We will show the settings for each of the components below 3A) inbound email settings 3B) Odata Adapter Settings as as shown below 3c) Main odata POST process response outbound email configuration is as shown below 3D) include an Exception sub process – Add a content Modifier with body showing the exception message and connect the email to email. For this integration I have copied the same the same email settings and changed the title to indicate exception. The Content Modifier settings are as shown Save and deploy the flow
- Test the filow 4A) Once the iflow is deployed we need to test end to end for successful post to validate the main process; To do this first we have to create XML data so that the format matches the metadata for SalesOrderSet of the odata service.. This is as shown bleow
<Note>EPM DG: SO ID SAP CPI Blog Test</Note>
<Note>EPM DG: SO ID 0500000000 Item 0000000010</Note>
We have seen how we can process inbound email attachment – transfer the attachment contents to message body and send this to odata adapter to invoke on Premise ECC odata service to perform deep insert and then send the response or exception to the configured email address in the outbound email configuration.