Technology Blog Posts by Members
cancel
Showing results for 
Search instead for 
Did you mean: 
Saurabh_Gupta1
Explorer
4,445

Application interface framework (AIF) AIF Documentation  is an framework which is widely used in S/4 HANA, Central finance for rationalization of different kind of interfaces with universal monitoring and error handling capabilities, underlying interface technology e.g. IDOC, XML etc remains abstract to the end user (Technical / Business).

With growing use-cases of AIF in large enterprise setting, there comes different challenges and one of them is understanding of automatic reprocessing capabilities.

In this blog, we would deep dive into details of technical know-how of automatic reprocessing.

Use case – We have set up XML/Structured persistence interface in AIF and based on a specific message number, AIF should do the automatic processing in certain interval for certain times.

First Tcode which is used in this process is /n/AIF/REP_AC_DEF where reprocessing action is defined. SAP has delivered standard function module ‘/AIF/RESTART_MSG’ for this purpose which is sufficient in almost all the cases however if you have a custom requirement then custom FM based on template FM ‘/AIF/TEMPL_RESTART_AUTO_REPR’ can be created and assigned in this Tcode.

Assigned FM would be used during reprocessing job, it will pick the properties/action/logic from original interface configuration for which GUID is being reprocessed.

Assigned runtime config Id(Tcode - /n/AIF/PERS_CGR) determines how the reprocessing should occur, e.g. packet size, server group etc.

srbh93_49-1739183898760.png

The automatic reprocessing is triggered by specific error messages for a registered AIF interface.

So the user has to register the AIF Interface and the corresponding error messages by message class and number for automatic reprocessing in the transaction /n/AIF/REP_AC_ASGN.

srbh93_50-1739183960903.png

 

  1. Assign the reprocessing action which was defined in previous transaction.
  2. Max repr. Counter - Define a maximum number of reprocessing attempts that can be executed for a failed data message.
  3. Minimum wait time (Seconds / Minutes /  Hours) - Define a minimum waiting time that must pass before the application can trigger a reprocessing attempt. 
    e.g. If a vendor is blocked and it takes around 6 hours for master data team to unblock the vendor then Minimum waiting time can be defined as 6 hours so that reprocessing can be attempted after vendor is unblocked.
  4.  Maximum wait time (Seconds / Minutes /  Hours) - Define a maximum waiting time before which             application must trigger a reprocessing attempt.
    e.g. if you are supposed to provide a acknowledgment of original AIF message with in 10 hours then maximum waiting time could be 10 hours so that all reprocessing attempts can be made to get the latest status based on the error.
  5. Intermediate status (In Process or Error) the failed data message displays while it's waiting to be reprocessed.

Conclusion

  1. First Reprocessing iteration should start only after “Min time” + original AIF message creation time has elapsed but No later than “Max time” + original AIF message creation time
  2. Next retry attempt of reprocessing job would occur after previous iteration completion time + “Max time” , if same errors still exists

Below FM / class method are called during original AIF message processing if the AIF error message meets the reprocessing criteria and it schedules the job based on defined reprocessing config.

srbh93_9-1739183685222.png

 

srbh93_10-1739183685238.png

 

Once above is executed, a job is created in ‘Scheduled’ status and can be checked in SM37. Planned start date for these jobs are defined based on Min and Max time defined in AIF reprocessing config.

Job name - /AIF/Namespace_RuntimeConfigID*

srbh93_51-1739184169882.png

Reprocessing data is captured in table /AIF/REP_MSG_CNT which provides valuable information like how many retry attempts are made , timestamp etc.

srbh93_14-1739183685252.png

srbh93_52-1739184243750.png

Working example – Lets check how this config works with a working example-

We have set the config as below where maximum retries are 2, Minimum waiting time is 1 Minute and Maximum waiting time is 10 Mis.

srbh93_53-1739184293915.png

Chain of events-

  1. Original AIF message was created on 15:38 which would schedule reprocessing job.
  2. First reprocessing job was released with a scheduled start time of 15:48 , the original message was created on 15:38 however ‘Max time’ was defined as 10 mins so reprocessing jobs has been scheduled for original + 10 mins.
  3. Second reprocessing was released with a scheduled start time of 15:58 since first iteration was completed on 15:48 so first iteration + 10 Mins.

srbh93_54-1739184353573.png

AIF Message job log with timings.

srbh93_0-1739184431446.png

While AIF message is waiting to be reprocessed, the status becomes ‘In Progress’ and sub status would be ‘Automatic reprocessing’ which can be checked in corresponding index table.

srbh93_1-1739184473282.png

 

Tips –

  1. Reprocessing Configuration performed for defining actions and assigning message is not transportable and should be done in each client separately.
  2. If there is an existing job scheduled between the minimum waiting time and the maximum waiting time, the reprocessing message is assigned to this job insteda of creating a new job.
  3. Runtime Configuration Group should be active and use Run Scheduled.