Skip to Content
Author's profile photo Former Member

How to use Automatic Reprocessing in AIF

Prerequisites:

  • You would like to implement AIF interface with automatic reprocessing of messages.


I would like to show you how to set up an automatic reprocessing for your AIF-interface.

I will use simplified interface BP_IN for business partner with the same SAP and RAW structures ZBPSTRUC:

/wp-content/uploads/2016/01/interface_bp_872565.jpg


For automatic reprocessing, we have to use a runtime group, created for our interface.

Use Tcode /n/AIF/PERS_CGR to create a runtime group, say RT1:


/wp-content/uploads/2016/01/rt1_872593.jpg

Don’t remember about checkboxs “Runtime Configuration Group Active” and “Run Scheduled”.

Then I create an Action…

/wp-content/uploads/2016/01/action_872586.jpg

…that uses a Function Module

actionFM.jpg

First, we just use a Break Point to make sure our interface is working 🙂

FM1.jpg

Then I create a simple report to call AIF Interface:


REPORT Z_AIF_SEND_BP.

DATA:

ls_input type ZBPSTRUC.   “our AIF structure

*Fill the structure with dummy data:

ls_inputBPTITLE = ‘Mr’.

ls_inputBPNAME_FIRST = ‘Mark’.

ls_inputBPNAME_LAST = ‘Levinson’.

/aif/cl_enabler_xml=>transfer_to_aif(

  EXPORTING

     is_any_structure = ls_input

     IV_QUEUE_NS = ‘BP’

     IV_QUEUE_NAME = ‘RT1’ ).

I don’t use AIF test tool because of Runtime Group specification in call.

Now let’s try to check if all is Ok and run our report. Then check /n/AIF/ERR:

ERR1.jpg

Yoo-hoo! It works!

Now lets try to setup an automatic reprocessing.

First, we need to define reprocessing action, using Tcode /n/AIF/REP_AC_DEF

/wp-content/uploads/2016/01/restart_action_872597.jpg

Take a look, that we need to use a function module /AIF/RESTART_MSG and our Runtime Group created above.

Than, we need to assign a reprocessing action in Tcode /n/AIF/REP_AC_ASGN:

/wp-content/uploads/2016/01/assign_restart_action_872598.jpg

Tips:

  • You can select a special message class and message, so only messages with specified errors will be restarted
  • You can define in what time period your message will be restarted. As shown, this message will be restarted in 5 minutes.

Also, you can define an intermediate status, for exapmle “In process”, “Application error” and others.

Now you can have some experiments with your AIF message, for example with changing time or Intermediate Status.

Hope this blog was useful for you.

Assigned Tags

      5 Comments
      You must be Logged on to comment or reply to a post.
      Author's profile photo Former Member
      Former Member

      Don't remember about checkboxs "Runtime Configuration Group Active" and "Run Scheduled".

      I believe you mean "don't forget"? Or that sounds like "don't think about pink elephants'. 🙂

      Otherwise thanks for usefull post.

      Author's profile photo Former Member
      Former Member

      Hi,

      I followed the steps mentioned. But I’m not getting data in AIF. Please check below screen shot. Also, please let me know if we can send data from a report / OData service to AIF? Please explain with steps. I checked many forums in SAP, but didn’t find any document for that.

       

      Author's profile photo SAP User
      SAP User

      Any idea on how to make this work for Odata Service?

      Author's profile photo Rahul VP
      Rahul VP

      Hi ,

      I would like to know for Manual Reprocessing or Restart of messages in AIF also do we need to create Runtime Group and assign them like explained above in the Blog.

       

      Best Regards,

      Rahul

       

      Author's profile photo RBEI RF-Project
      RBEI RF-Project

      Hi

      The blog is clear & crisp

      If the Message is failed, then this auto reprocessing will reprocess the message again & again?

      Till the maximum counter ?

       

      But for the reprocessing is not initiated even after maintaining the above steps for the error messages.

       

      Regards

      Praveen G