Third-party Cloud Integration via SAP PI: Customized Framework to Integrate SAP to Third-Party Cloud (ZUORA) Part – 1
We have come a crossed scenarios where we need to integrate with SAP cloud products like Success factors and C4C(Cloud for customer), had not been the case where SAP doesn’t have any standard ready to use packages to download and deploy in SAP PI for designing and configuring these products, one can imagine the complexity of designing and configuring with these products. Thanks to SAP as it has standard content to cut down time for developments and it almost become plug and play kind of integration via PI with very less changes and has enough support to customize and configure.
Recently had encountered with a requirement where SAP PI need to integrate with a third-party cloud (ZUORA), which has its own API option to integrate with other applications, those we haven’t heard about ZUORA, in brief words it’s a third party application provides billing and payments services for an enterprise.
This blog targets the approach of integrating SAP PI with ZUORA API, helps you to give better idea and clear path to design and configure. The first part mainly focuses on business requirement and high level process and approach towards the solution, in second part I will be discussing my technical approach for this solution. I hope this blog gives you a big leap towards implementing your solution by cutting down your time of analysis from ground zero.
Product Invoices are created in ZUORA system. A nightly scheduled job in SAP executes the Wrapper program which triggers the PI system to communicate with ZUORA system with Query API and fetches the data pertaining to ZUORA Invoices.
Once the data is fetched from ZUORA system, data is collected in internal tables of Wrapper program. Along with ZUORA invoice data, some default data in SAP needs to be added to internal table. Once all the required data is collected to create a Billing Request and Invoice, data is passed to Sales order Create BAPI and Invoice create BAPI to raise Billing request and invoice.
Once the Invoice is raised and posted to accounting, transmission log has to be passed back to ZUORA system via PI system.
- We need to go through the API documentation to understand how this is feasible to SAP PI system and what is adapter suitable for this API, as there is not much explanation about integration with middle ware in it.
- Identifying suitable architecture for business requirement as this interface is real time, main focus is on performance of it and optimization of interface while processing request/response with ZUORA API.
Solution Requirement and Motivation:
Zuora generates Invoice records with line level detail and sales tax based on the Subscriptions and RatePlanCharges created on a transactional basis. Expectation from middleware is to have connection established and communicate with API and translate messages from ZUORA to ECC.
As shown in following figure most is expected from Interface Layer to process invoice items, there is a need to have customized fields from SAP side those needs to map to corresponding fields in API. Once these details passed to ECC system corresponding BAPI takes these information and proceed with creation of order and invoice documents in ECC side.
Following are the steps that illustrates process flow from ZUORA system invoice generation to posting it in SAP ECC.
- Zuora generates Invoice records with line level detail and sales tax based on the Subscriptions and RatePlanCharges created on a transactional basis.
- Custom interface Exports Invoice header, Invoice Item, and Taxation Item tables.
- Custom interface transforms the data appropriately to map to SAP interface tables.
- Post Invoice Request or Invoice entries to SAP.
- Consumer Invoice data and post to SAP AR.
- Optional: Update () Invoice records with a flag indicating successful or failed interface.
- Invoices are flagged as ‘Sent to SPA or ‘Error’.
We have outbound process from ECC system to ZURO to create payment/ InvoiceAdjustment/ ItemAdjustments, this should have mechanism where from ECC side data pertaining to specific transaction needs to be transmitted to third-party system with appropriate mapping in place, this step transforms ECC proxy request into ZURO API request form.
Following figure depicts the outbound process from ECC.
- Transactions that influence the Invoice balance, such as Cash application, Bad Debt write offs, and Credit Memos.
- Create the appropriate Zuora transactions:Cash – Create () Payment.
- Refund (cash reversal) – Create () Refund
- Bad debt – InvoiceAdjustment
- Credit Memo – InvoiceItemAdjustment
- Zuora stores the appropriate transaction, updates the Invoice balance, and for credits that involve reversal of revenue, recognizes immediately or amortizes reversal of revenue.
Part-2 of this blog will discuss in details about technical approach for this integration, highlights are technical architecture, handling SOAP API from ZUORA, building query from ECC etc…