Delayed processing of AIF messages
Since support package 3 (AIF 3) or support package 10 (AIF 2) AIF provides a mechanism that allows taking control over the point in time in which messages are processed as well as the amount of messages that are processed. However there are limitations which will be explained in detail below.
To use this feature you need to maintain a Runtime Configuration Group (RCG) in Transaction /AIF/PERS_CGR.
In this RCG you need to specify a Namespace (NS) and a Runtime Config. ID (Name) by which the RCG will be identified later on.
It is vital to uncheck the „Runtime Cfg Active“-checkbox, as this will prevent the messages from being processed instantly as soon as they arrive. Finally you probably want to check the “Run Scheduled” and “Schedule Packages” checkboxes and specify how many messages you want to queue up and how big the packages should be that are processed per background job. This given example would queue up 200 messages and assign them to a run until it is marked “complete”. During processing of a run those 200 messages are split into 5 background jobs with 40 messages each. If you dont check the two checkboxes will be processed in the process of /AIF/PERS_RUN_EXECUTE rather than inside a background job.
Now you just have to specify the created RCG using its namespace and name while calling the /AIF/CL_ENABLER_XML class.
You should now see your incoming messages queue up in status “in process” in the AIF Error Monitor /AIF/ERR.
Once the configured amount of messages is available the run is considered complete and can be started using the report /AIF/PERS_RUN_EXECUTE
Here you need to specify the runtime configuration again and when you execute the report it will start all completed runs according to the runtime configuration. You probably already see that this is the cause for the limitations I mentioned in the beginning of this article. As long as the run is not completely full, no messages are processed. If there are several runs completed then all messages in those runs are processed. There currently is no way to limit the amount of runs that are processed. However there is a SAP-Note (Note Number 2215829 ) that covers the execution of incomplete runs to prevent messages from idling forever inside an incomplete run if no more messages are received.