Wednesday, June 11, 2014

Managing error handling in SOA with PPO

Since a couple of years there is almost no SAP CRM implementation that is not dealing with Web Services. It might be a front end that is calling CRM functionality or an external solution that CRM calls for extra information. One of the challenges with in this SOA landscape is error handling and reprocessing of these errors. SAP offers a solution with it’s Post Processing Office, PPO.  In this blog we will focus on the opportunities this tool offers, and the business benefits that this will provide.



To explain the functionality of the PPO we will handle two use cases.
  1. An a-synchronous service call to update a CRM Quotation
  2. Two synchronous service calls to CRM with dependencies
    • a business partner create service call
    • a sales order create service call    

Use Case 1

Updating a CRM document  by using an a-synchronous service can be tricky. The document can be locked for example, and with an a-synchronous call you cannot inform the caller. The Post Processing Office gives you multiple options for settling the error.
You start by creating a so called Post Processing Order. This order is the data container for your service call. It can be reprocessed manually in the Post Processing Office, but it can also be scheduled to be reprocessed automatically.
The code to execute the Post Processing Order is all custom code. You create a new class, implementing action interface provide by ECH framework (Error and Conflict Handler),  for each process. In this class you create methods for processing the order. The Post Processing Office offers you the GUI transactions to monitor the created orders, and to execute or even test them.

Use Case 2

Dependencies in service calls is always a risk, but in many e-commerce solutions you run into the problem that you wish to create a new Business Partner and create a sales or service order for him at the same moment. The Post Processing Office offers a solution in scenarios like this as well. Since the call to create the order will fail if the BP is not created yet, you could create a Post Processing Order for this call. You can set the repeat mode to automatic for all orders of this order type and execute the action every 5 minutes. If the order fails to be created in the initial call, the Post Processing Office will retry in 5 minutes, most likely the BP will be created by then.
You can customize your own Post Processing Order types, business processes and worklists. This gives you flexibility in the selection of orders in processes, like manual selection of orders, or the automated processing customizing.

For a detailed guide on how to setup this very useful tool, you can use the following link to a SCN post of Soumya Mathew.
SAP document How To Setup Forward Error Handling in PI Scenarios
URL: http://scn.sap.com/docs/DOC-34091

No comments:

Post a Comment