Skip to Content

PI/XI: Forward Error Handling (FEH) for asynchronous proxy calls with the use of Error and Conflict Handler (ECH)

Forward Error Handling is a relatively new (as it already existed in the past in some scenarios) concept of monitoring and solving errors in asynchronous message processing on the receiver’s endpoint. SAP application systems use Error and Conflict Handler (ECH) to implement FEH into real scenarios with the use of PostProcessing Office. As of EhP4 for ERP (and generally SAP Business Suite 7.0) ECH is integrated with PI/XI’s local monitor and you can start handling all the proxy errors with it’s use. What does it mean in general? It means that as of now you don’t need to relay on handling proxy errors with XI monitor but you can a much better tool which (PostProcessing Office) which works more like IDOC monitor for IDOC messages.

Why would I want to use it?

As soon most of SAP’s proxy messages (also Web Services) will be using that as a standard way to handle errors.

How can I implement it then?

At first I will show you a typical customizing and configuration on how you can forward all of your proxy messages into ECH and in the next blogs I will continue with the rest of ECH’s functionalities, like reprocessing messages, changing messages, setting different statuses (complete, fail) and also how to configure some of those post processing activities to run automatically.

Scenario’s Description

Our inbound proxy in ERP system normally used to throw an exception in case something went wrong. We will try to change this behavior and whenever an exception should be thrown we will pass the message to the ECH service in order to be able to process it in PostProcessing Office.

Step 1.

At first you need to active FEH in your SAP Application client and you can do that using SPRO menu:

– Cross Application Components
– –  Processes and Tools for Business Applications  
– – – Enterprise Services
– – – – Error and Conflict Handler
– – – – – Activate Error and Conflict Handler (view – FEHV_ACTIVE)

Step 2.

The second step is to create an ECH business process – YDEMOTEST in my example – which you need to assign to your proxy class and set up it’s persistence with CL_FEH_MESSAGE_PERSISTENCY

– Cross Application Components
– –  Processes and Tools for Business Applications  
– – – Enterprise Services
– – – – Error and Conflict Handler
– – – – – Define Process Data

Step 3.

Now you also need to create a business process in the PostProcessing Office – via a view – /SAPPO/VS_BPROC

Step 4

Then you need to assign ECH business process to PPO business process using

– Cross Application Components
– –  Processes and Tools for Business Applications  
– – – Enterprise Services
– – – – Error and Conflict Handler
– – – – – Define Postprocessing  (view ECHS_PP_PROCESS)

Step 5
The only configuration left would be to assign proxy method to the FEH process and you can do this using a view – FEHV_PROXY2CMPR.

Now it’s time to do the coding in our proxy where we’ll need to call ECH whenever the exception should be thrown.

Step 6

We need to add a new interface IF_ECH_ACTION to the proxy class as shown in picture below.

and once you add this you should see a few new methods in your class.

Step 7

The only last thing you need to add is an attribute – GO_ECH_ACTION which is a static attribute assigned to your class.

Step 8

The code below will call ECH once the proxy’s exception is thrown (so please remember to call the proxy exception with the use of fault messages) and you need to insert it into your main proxy’s method. As you can see we need to call method collect of the class cl_feh_registration in order to send the message to ECH. You need to populate at least ls_bapiret struture in order to send an error description to the ECH.


DATA:  lr_feh_registration   TYPE REF TO cl_feh_registration,
       l_error_category      TYPE ech_dte_err_category,
       ls_main_object        TYPE ech_str_object.

     lr_feh_registration = cl_feh_registration=>s_initialize( ).
     l_error_category = ‘DCE’. “as per table  /SAPPO/SERR_CAT.

     ls_main_object-objcat  = ‘1’.
     ls_main_object-objtype = ‘SFLIGHT’.
     ls_main_object-objkey  = l_flight_id.

*for objtype please have a look at table /SAPPO/S_OBJECT

*please  remember that you can put anything (like Order, Delivery number,  Partner ID, etc.) into the objkey value and this can later on help you  in selecting the correct message in the PostProcessing Office


       CALL METHOD lr_feh_registration->collect
           I_SINGLE_BO      = ls_api_data
           I_ERROR_CATEGORY = l_error_category
           I_MAIN_MESSAGE   = ls_bapiret
           I_MESSAGES       = lt_bapiret
           I_MAIN_OBJECT    = ls_main_object.

      CATCH cx_ai_system_fault. “messages are not forwarded to FEH, XI monitor is used


Step 9

We also need to instantiate the s_create method of the new interface with the code below. 

  if NOT go_ech_action IS BOUND.
    CREATE OBJECT go_ech_action.
  r_action_class = go_ech_action.


Testing the scenario


Once you run the message and the error should happen you should be able to see the message with a new status in local PI monitor (transferred to external application)

and also from the PostProcessing Office – /SAPPO/PPO2 transaction.

Once you select the message you should be able to see the details (like all errors) and also be able to view the content of the message.

Second part of the article:

PI/XI: Forward Error Handling (FEH) for asynchronous proxy calls with the use of Error and Conflict Handler (ECH) part 2



There are some new features planned for future releases of ECH like new payload editor, attachments handling, support for payload attribute searches but for details on those we need to wait for SAP’s official info.

You must be Logged on to comment or reply to a post.
  • Hi Michal,

    It`s nice to see this new (at least, for me) feature. I thought that SAP would never give us a solution for this kind of problems.

    Once, I`ve developed a ABAP program to handle failed messages at receiver side, allowing the user to resend a failed message, search messages based on payload, edit the payload (for some specific cases) etc.

    Thanks for you valuable blog! Keep bloggin`!

    • Hi Tobias,

      I was looking for something like that on SDN and did not find any blog so I started writing also yesterday but I didn't manage to get the printscreens till today 🙂

      Michal Krawczyk

      • Your blog is really great - and ECH/FEH ist so useful that there should be even more blogs about it. I already thought about creating a page in the wiki to collect the information which is spread on many different places in What do you think?

        Best Regards,

        • I'm kind of really hoping this was done! Okay it is probably unlikely but I would like to see the wiki, if possible. It sounds interesting.

  • Michael
    Search is already there as I am using FEH in SRM here, all you have to do is get the correct XPATH for the field whose value you are searching for.
  • Hi Michal, I've been looking for a blog like this for a long time.
    Just a quick question what is r_action_class for? It hasn't been declared.


  • Hi

    This seems to be something that will remove the use for IDOCs because it is easy for the business to monitor. This seems to be possible to provide the same and more abilities than Bd87.


  • Hi Michal, I don't know in your version of ECC, but in mine I get short dumps if I don't pass values to the message fields of the bapiret2 table like the the following in the i_main_message parameters.

      ls_bapiret-message = 'Error message'.
      ls_bapiret-message_v1 = 'Error message 1'.
      ls_bapiret-message_v2 = 'Error message 2'.
      ls_bapiret-message_v3 = 'Error message 3'.
      ls_bapiret-message_v4 = 'Error message 4'.

    Thanks for helping on this, I think this is the only useful documentation existing around FEH, other than SAP code within the standard Enterprise Services.


  • Hi Michal

    This is a nice blog on FEH. We are working on ECC 6.0 Enhp 5 and trying to setup FEH.

    I request you to please let us know the view name for Step 2 as we are not able to find the SPRO path for step 2. Are these settings different for Enhp 5?

    Also could you please elaborate on purpose of YDEMOTEST business process. Can we use existing business process in Step 3 and skip step 2. What would be impact?

    Appreciate your help.



    • Hi,

        I also had the same problem but you can find back the menu:

          * Goto SE24 and display IF_ECH_ACTION

           * Click on Documentation

           * And the use the link to 'Define Process Data'.



  • Hi,

    From the last screen shot, where i can see the data of message. Now i select 'Display' or 'Change' and navigate to list of fields, I could only see the data element behind the fields, but not the field names. Is there any way to see the field names instead of data elements?

    Thanks in advance.



  • Hi Michal,

       I am working on a custom ESR in which we are handling the FEH using the same methods which you have mentioned. Now issue is when there is any error in the proxy FEH is getting called but the status in SXMB_MONI is still showing the checkers flag (Processed successfully) where in for the standard ESR whenever the FEH is called flag set will be Transfer to External Application flag. Can we achieve this through custom ESR's.

    Thanks & Regards,

    Uday S.

  • Hi michal,

    We are on ECC6 EHP6, I don't the see the menu you have shown in SPRO, instead I see the below menu. I don't see the "Define Process Data", Please guide.


    ---Error and Conflict Handler

      --Activate Error and Conflict Handler

      --Create Process for a Service Operation

      --Define Business Processes

      --Define Business Process for Postprocessing office

      --Assign Caller to a Business Process

      --Define Resolution Strategy

      --Define Payload attributes

      --Make Payload-Specific settings



  • Hi Folks,

    We are using standard proxy(Enterprise services) between SRM and ECC. Our one of the inbound proxy is failing in ECC with status 'Transfer to external system'. We are not able to process any of the error messages.

    Do we need to configure ECH to process errored inbound ES (proxy) messages?

    If yes, do i need to configure all the steps shown above(I am not sure as this is standard ES proxy).



  • Hi all,

    On my current project we are looking to set up include FEH & ECH on PI to our existing PPO setup. However, our PI has just been upgraded to Java single stack and I cannot find any information how these ABAP elements are taken up in a Java only installation.

    If anyone can point me in the right direction, send me a link or some material it would be greatly appreciated.