PI/XI: Forward Error Handling (FEH) for asynchronous proxy calls with the use of Error and Conflict Handler (ECH) part 2
In the first part of my article about FEH and ECH PI/XI: Forward Error Handling (FEH) for asynchronous proxy calls with the use of Error and Conflict Handler (ECH)I’ve described how to prepare a custom proxy call to make it use ECH framework for exception handling instead of using standard fault messages. In this part I will concentrate on simple examples of other available methods:
Once you open a message in the PostProcessing Office you can see that there are a few possible ways to handle en error. You can either repeat (in case the error should not happen anymore), confirm (complete the message in case of an authorization issue the message was processed manually) or discard (fail message in case the processing should not be repeated at all).
Within this method you can call the proxy’s method one more time with the same data. The best idea is to copy the standard method into a new one (let’s say DO_APP_PROCESS as in my example) add the same importing parameter and exception but also add bapiret exporting parameters which will indicate if the retry was successful or not this time. If the call was not successful again you just need to invoke the exception and call collect method as show in the first article. Below you can find a very simplified version of an retry method:
|DATA: lr_feh_registration TYPE REF TO cl_feh_registration,
ls_api_data TYPE YYMT_TEST.
*— Create FEH instance for Retry —————————–*
CALL METHOD lr_feh_registration->retrieve_data
me->DO_APP_PROCESS( exporting input = ls_api_data ).
*in your own method (do_app_process) you can have output parameters (bapiret)
*——- Update FEH to resolve ticklist ——————————-*
Now once you use the repeat button you will see that the repeat call was correct.
Within this method you can do multiple things like sending an e-mail message to a correct use that he needs to reprocess the transaction manually, etc. and as the end thing you need to call the finish method as shown in the code below.
| CALL METHOD cl_feh_registration=>s_finish
i_data = i_data
e_execution_failed = e_execution_failed
e_return_message = e_return_message
When you confirm the message in the PostProcessing Office the status should get updated accordingly.
The last method should be used when you cannot do anything with the message and just want to delete it’s status so it will not longer be reprocessed by anyone. You can also send e-mails and other alerts from it prior to calling the s_fail method as shown below.
|*— Update status in FEH ——————————————–*
CALL METHOD cl_feh_registration=>s_fail
Again using this method should update the status of the message in ECH.
Using any of the buttons/methods described should udpate the global message status.