Demystifying AIF: Use cases
In this blog I would like to talk about some points and arguments in a conversation with the customer about AIF. It will be useful if you would like to help your sales guys or customer directly to understand – why do they need AIF ?
We already have a PI/PO…
The main idea of Application Interface Framework is to monitor an APPLICATION and BUSINESS errors, not TECHNICAL. If you use PI/PO as a transport layer, you can monitor adapter errors, mapping errors, XML-validation exceptions, routing problems etc. But it is very likely situation – your message (e.g. Business Partner creation) were delivered without any errors in PO, but it’s impossible to save Business Partner data because the country name was unacceptable. So, the next point – Value Mapping.
Value Mapping
Of course, you can set up a value mapping replication to PO and use it in your mapping. But that way you don’t have any possibilities to correct the data “on the fly”, only in master-tables. Anyway, it’s not a good idea to have VM in PO, but in AIF as a local VM-provider.
For example, we can receive “Russia1” of “RF” instead of “RU”. Technically, “Russia1” and “RF” are Ok for XML-schema element “String”, but not for the system “Country” field. So, you create a Value Mapping Rule in AIF, enter a lot of dummy things like “Russia1” and “RF” and map it to correct value “RU”. Now your AIF system will automatically map this values. If your receive “new” dummy value, say “Russian Fed”, an AIF user will get a VM error and the button if AIF interface to fix it! Very cool and simple.
Mass processing
Say, you want to get a thousands of records to record in your system. But you need to run one Function Module for each record. Of course, you can use PO mapping to split the messages and send it to your system separately. But that way you get thousands of messages to deliver – not so good idea for performance.
In AIF you can receive all the records in one message and then execute an FM for each record!
Few more cases. Say, you want to check all records in one FM, and then save the records separately – of course it is possible also with AIF actions!
Automatic reprocessing
You received few messages from different systems. First, you need to create a Business Partner record that came from System 1, then you need to create a Contract record from System 2.
Due to technical issues you received a Contract record first. If you try to create a record, based on non-existent Business Partner, you will get an error. But you can use a simple Check in AIF – if there required BP is created already or not. If not, you can automatically reprocess a message in 10 minutes or something like that! So, we are giving a chance to receive a Business Partner record.
Error corrections by user
In AIF you can fix some errors by user by setting up a fields as editable.
Case: you are receiving an information from flight booking system. There is a “Phone” field with a phone numbers in different formats. Say, “tel 8-10-342342423”, “+7 34234242 3 New cust” or something like that. In some cases it is not possible to parse this values automatically and a system needs user help.
You simply turn on the field as editable – et voi la !
Of course, it can be based on roles and permissions…
Roles and permissions
You decide, if all the users can see AIF errors for all interfaces, or it is only possible the interfaces for this user. It is very flexible and simple model on Recipients in AIF.
It’s only few use cases showed in this article, but clear your mind and continue to invent!
Hi "Former Member",
Thank you for writing this down and trying to make sense of AIF (as a licensed standalone program).
Unfortunately, for me, AIF is still not demystified after this blog.
First of all: Do your points apply to all AIF enabled interfaces like Proxies and IDocs?
I don't see the reason to use AIF for many of the use cases described by you:
We already have a PI/PO
Yes, Business Monitoring is not done on the middleware. There are other ways of doing business monitoring. Either using the standard transactions which mostly are ok for a trained user, or for example by using Message Flow Monitoring of SAP Solution Manager.
Mass processing.
With Proxies I can process a large message with many records in one transaction also without AIF.
IDocs can be collected and processed in one batch as well. No reason to buy AIF to achieve this.
Automatic reprocessing
The way you describe it can can easily be achieved by a restart job for both IDocs and Proxy messages. If one would need to restart messages based on a certain logic, I would write and schedule an ABAP program that does the checks and restarts a message. With AIF, I think you would also need to write ABAP code for this, so where's the advantage of using it?
Value Mapping
If I have to write a custom program to process my Proxy message anyway, I can well also define a Z-table with maintenance view where users can store their values.
For IDocs, there is the concept of conversion rules (BD62) which covers that afaik.
WebServices, BAPIs or RFCs can be encapsulated by an ABAP Proxy, which would do the value conversions before calling the actual program. Again, no need for AIF.
The only realy advantage with AIF over the standard that I can see so far is the feature:
Error corrections by user
Especially the narrowing down of the permission to single field level can't be achieved easily otherwise. However, editing of complete IDocs is possible with WE02/05 and the according authorization (including restricting the IDoc type that is permitted to be edited, using a custom authorization object).
Another possible use case which is missing in this blog would be Alerting via Email. This is somewhat helpful for IDoc messages or maybe web services (not sure about that).However, for Proxies, you can create an Alert Category (t.code ALRTCATDEF) and alert rule in the standard SAP Alert Framework.
So I'm seriously still looking for somebody who can explain me the real value of AIF and give really good use cases, for example with estimated time saved when using it compared to standard solutions and custom implementations.
Hi,
I just need some guidance on Mass processing. We have AIF where we are using file upload to upload a XML file with header and line item. There are multiple records in the file. This file is assumed by the File Upload program of AIF to be a complex file structure and therefore we are unable to specify the block size. We want the checks in Structure mapping to be run record by record. If a structure mapping for a single record is failing then we want AIF to proceed with the next record and so on. Then the action needs to be called for all records which did not have a mapping error.
However at the moment AIF is not calling action functions if even a single record has mapping errors. As the other records are successfully mapped and as only some records have given error during mapping, I expect the action function to be called for the records which did not have mapping errors. Please if you can guide on how you resolved this issue.