As of AIF 3.0 a new, fantastic feature has been introduced - AIF serialization. Together with my two colleagues from Int4 - Michal Michalski and Krzysztof Luka we've decided to describe how do different options of AIF serialization work as we believe it's usage can be a vital part of almost every AIF implementation due to it's unique benefits.


SAP Press has published our book with it's new format - E-bite. E-bites are supposed to be smaller books available only in electronic format and they need to concentrate on a single topic only - in our case serialization. Our book contains step-by-step instructions and screenshots that will enable you to explore your serialization options in SAP Application Integration Framework in no time, starting from the configuration up to monitoring and troubleshooting of the AIF serialization.




Where to buy:


SAP Press - Serializing Interfaces with SAP AIF




My first book on AIF topic for business users - SOA Integration - Enterprise Service Monitoring (LIE, FEH/ECH, AIF)

SAP AIF with release 3.0 has got many new features and one of them is a much tighter integration with SAP rule engine - BRFPlus/DSM. In this video presentation you can find out why it’s worth using AIF together with BRFPlus/DSM: SAP Application Interface Framework with SAP NetWeaver Decision Service Management


The main topic of this article will be to show how quickly and easily can a BRFPlus rule be used in the AIF value mapping from the development point of view. For a start we need to design a BRFPlus function which can later be used within AIF. There are however two important things to be considered here:


a) if you’re building a new BRFPlus function together with a new BRFPlus expression (for example a decision table) you can try building it according to the AIF requirements (for input parameters). This basically means that the BRFPlus function can be used in the „Functional mode” with just one top expression (for example - decision table) which has the same input/output parameters


b) if the BRFPlus expression is already developed you have to develop a BRFPlus function according to the AIF requirements (for input parameters) but you may need to go for a function with "Event mode” so you can map the AIF required input and output parameters to the existing expression within the BRFPlus Ruleset (assigned to the function)


In this article we will only concentrate on the first approach (so both the BRFPlus function and expression are new). The first step would be to create a BRFPlus function with required input parameters which need to can have names listed as per the figure below which would correspond to the fields (Field1…Field5) from the AIF structure mapping later on. The output value does not need to have any specific name.




Next we need to prepare the BRFPlus expression (for example decision table) which will be used in the scenario and assign it to the BRFPlus function. It would be wise to test the function from the BRFPlus workbench to see it working using the start simulation button.


The rest of the customizing steps can be done within AIF and we need to start by defining a new value mapping where we need to select which BRFPlus application and function we will be using as shown in the figure below.




In order to use the new value mapping you need to add it in the AIF structure mapping keeping in mind that selected source fields will be used by the BRFPlus function exactly as shown in figure below.





After all of the mentioned steps are done you can try and test the end to end scenario and if you did everything as explained the value from the AIF interface should get mapped using the BRFPlus.



BRFPlus can also be used in AIF structure mapping and AIF checks and not only with AIF value mapping.



Business Rules Framework Plus Integration from

Requirement: To map child level field in a nested structure in AIF.


Source field: StreetPostalCode   --> (/Supplier/AddressInformation/Address/PhysicalAddress/StreetPostalCode)

Target field:  RegionName          --> (/Supplier/AddressInformation/Address/PhysicalAddress/RegionName)




Step 1: Root level structure mapping.


Assign "Supplier" as the source and target structure.




The next segment in the target structure after Supplier is "AddressInformation".

So, select "AddressInformation" as the field in destination structure and assign it as a Sub-Table as well.




Step 2: First level structure mapping.

Assign "AddressInformation" as the source and target structure. This time "Indirect Mapping" checkbox is selected as well.


The next segment in the target structure after AddressInformation is "Address".

So, select "Address" as the field in destination structure and assign it as a Sub-Table as well.




Step 3: Second level structure mapping.

Assign "Address" as source and target structure. This time as well "Indirect Mapping" checkbox is selected.



The next segment in the target structure after Address is "PhysicalAddress".

So, select PhysicalAddress as the field in destination structure and assign it as a Sub-Table as well.




Step 4:  Third level structure mapping.

Assign "PhysicalAddress" as the source and target structure. This time as well "Indirect Mapping" checkbox is selected.


Map the target field "RegionName" with the source field "StreetPostalCode".



In SAP back-end system the newly created AIF custom interface fails to display log in transaction /AIF/ERR. This is because the application log sub object is not created in the system.


For example: In transaction /AIF/CUST -> Interface Development -> Define Interfaces, a newly created interface IC0029 belonging to namespace ZHR.




Step 1: Go to transaction SLG0.


Step 2: Select the entry "/AIF/LOG" and double-click on "Sub-objects".



Step 3: Go to edit mode and create a new entry for interface IC0029 along with its namespace and Save.



An entry for IC0029 gets created in SLG0.



Today, I`d like do some enhancements on another main AIF tool - 'Interface Monitor'.

The enhancement spots '/AIF/INTERFACE_MONITOR' is in same package with 'Error handling'.



1, To create an enhancement implementation and related implementing class, as below figures:



2, Write your code in method 'CHANGE_CAL_COLOR_TIP_BY_DATA'.

    Importing parameter 'IT_ALL_KEYS' holding all the interfaces which you are monitoring.

    Changing parameter 'CR_CALENDAR' is that Calendar`s instance. Example code as below:


     In this code snippet, I specified Feb.18&19&20 with yellow and tooltip 'Spring Festival'.


3, Result in 'Interface Monitor', run '/n/AIF/IFMON'.



NB. In my ABAP code, some grammar is news for Release 7.40, I just use it to practice.

You`d better use old grammar to avoid syntax error.




When an SAP backend system is being called from another SAP backend system with the use of tRFC currently we have no ways of monitoring errors in such integration scenarios. In case the tRFC call fails on the destination system in some cases the users on the calling system would like to:


a) know what kind of error occured in the destination system

b) restart the tRFC call without running the initial transaction


AIF 3.0 (new version available as of October 2014) offers a new functionality which can help to solve both of those issues. It’s now possible to create an AIF interface which will enable monitoring of tRFC calls which ended with an error on the destination system. Furthermore with AIF 3.0 it’s also possible to restart those errors and even debug the tRFC calls on the destination system directly from the calling system. Below you can find a list of steps required to customize such an integration scenario.



Step 1


Create an RFC enabled function module on the destination SAP backend system or use an existing one.






Step 2


Create the AIF interface on the SAP backend system which will be calling remotely the RFC created on the destination SAP backend system from the previous step. You can create this new AIF interface by running a new, special report: /AIF/RFC_FUNC_GEN with the following parameters:


  • RFC Type - select - tRFC status table

  • Original RFC Function Name - the name of the RFC enabled function module which exists only on the destination SAP backend system (from Step 1)


  • Prefix of New Objects - prefix for the new created objects


  • Playback Function Name - this module will be created in the calling SAP backend system with the same signature as the original one from the destination . We need this module for the data transformation.


  • Name of AIF Structure - which will be automatically generated on the basis of the structure of the RFC enabled function module


  • Destination for Original Func. - this is the RFC destination of the SAP backend system on which the RFC enabled function module will be executed (destination SAP backend system)


  • Namespace - namespace of your new AIF interface


  • Interface Name - interface name of your new AIF interface


  • Interface Version - interface version of your new AIF interface






Step 3


Execute the report/transaction on the calling SAP backend system which will send the data to the destination SAP backend system. Only if the tRFC call fails we will be able to monitor that call in AIF. In case the call is successfull we will not see any data in the AIF monitoring transactions. As you can see on the figure below the failed tRFC calls are visible in the AIF monitoring transaction and we can even monitor the data from the RFC structures (name, data, creator).





Once the call failes as shown in the figure above we will be able to restart the call from AIF using the restart button or even debug the tRFC call using the debug button. Debugging will take the user from the calling SAP backend system to the destination SAP backend system on which the RFC module is being executed as shown in the figure below.




Please keep in mind that once all tRFCs calls are successfully corrected all the entries from the AIF monitoring transaction will be gone and not marked as successfully completed as with other AIF scenarios.




tRFC and qRFC - SAP Application Interface Framework - SAP Library

Sometimes we need to post a transaction which locks a certain object and other transactions using the same or other interfaces cannot get posted at the same time. What happens in that case is that interfaces fail and only the first one gets posted as shown in the figure below.





Then the interfaces which failed need to get restarted, either manually or in some cases we can restart them automatically.


AIF 3.0 (new version available as of October 2014) offers a new functionality which can help to solve such issues without the necessity of restarting the interfaces which failed. The new function is called - Serialization - Paralell Processing and in this article I will try to describe the steps required to customize this new function.


The idea behind this functionality is that we can use a predefined locking object which can tell AIF if the transaction is currently being locked and if such a situation happens, we can wait for a predefined amount of time, before we try to process the message so it will not fail with the locking error. We can add this functionality to any of your existing AIF interfaces suffering from the locking issues using just the customizing.



Step 1


At first we need to define the fields of the interface which can be assigned to the locking objects. With AIF we can do that by defining the Key Fields. In order to do that we need to create a new AIF index table with all fields which will be used by the lock object as per the figure below. In this case I’m using a flight demo scenario and I will have two locking fields (AIRLINE_ID and BOOKING_NUMBER).





Step 2


Then we need to define both of the Key Fields in the /AIF/CUST/ - Error Handling - Define Interface-Specific Features





Step 3


In the next step we can define a serialization object /AIF/CUST/ - Interface Development - Additional Interface Properties - Define Serialization Settings, where we can select the locking object and most important parameters like: wait time (time the AIF runtime needs to wait before processing the interface which was locked) and Max. No of Retries (self explanatory). In case of the flight booking scenario we can use the ESBOOK lock object as shown in the figure below.




Step 4


Once the lock object is assigned we need to assign it to the AIF interface and we can do that in the same menu as Step 3.




Step 5


The last customizing step is to assign the locking fields to the AIF Key Fields (defined in Step 2). The assignment is done on the basis of the locking object fields and Key Field sequence number.






Once all the settings are done we can try testing the new scenario and if we send multiple messages with the same lock key at the same time this time they should not fail but stay in the processing mode (till the wait time from Step 3 is reached) as shown in figure below.





Once the lock is free and assuming the Max. No of Retries parameter from Step 3 is not reached all of the interfaces should get posted without any issues as shown in figure below.






I hope that gives you an idea on how this type of AIF serialization is working. In the next articles I will try to describe other features of AIF serialization (external, internal indexes).

In last blog,,

I wrote how to enhance toolbar on View3. Today, i`d like enhance the editability of cells on View3.

As you know, we could set cells editable or not by Customizing,

/AIF/CUST -> Error Handling  -> Define Interface-Specific Features/Define Namespace-Specific Features -> Define Changeable Fields.


Except this, we could do more by implement BADI '/AIF/V5_CHANGEABLE_FIELDS', like according record type to set editable,

or according a certain value of other cells to set current cell editable. Let`s do it.


1, Create BADI Implementation,  '/AIF/V5_CHANGEABLE_FIELDS'.



2, There are three methods, which is independence.


4,  The Method 'INIT', it is called before every displaying data. we could write code in it like below:


The result as below, 'ADD_DATA1' the whole column become editable. 'ADD_DATA_KEY' is editable, due to i set it in Customizing:


5, The method 'GET_FIELDS_PER_RECTYPE', will be called for record type under structure in View2.

    CR_DATA containing the whole data of current message which you double click.


   The result as below, 'ADD_DATA2' become editable:


6, The method 'GET_FIELDS_PER_LINE', will be called for each data in View3. CT_DATA is current data in View3.

    How many data rows in View3, this method will be called how many times. In my example, it will be called twice.


  The result as below, 'ADD_DATA3' column, only the cell which 'ADD_DATA1' equal 'CNN' become editable :



With this BADI, you could dynamical set cells editable, it make Error Handling more flexible.




As of October 2014 the new version of AIF (3.0) is available and with the new version lots of new functionalities are available. One of them is the new mapping Analyzer. With this new tool you can now trace single steps of a mapping execution and this way find the issues much more quickly then if the mapping program runs in a single run. This is a different approach if we compare the SAP Process Orchestration Message Mapping tool which cannot display the intermediate results of the mapping. Let's see how does it work.



Step 1



At first you need to create an interface and a mapping which can be used by this interface.



Step 2



Next you can test the interface in the "Interface test tool" - TCODE - /AIF/IFTEST/ and after you populate the data in the test structure use the new Analyze button to go open the new tool.





Step 3



In the Process Step section you can now open each of the nodes of the Structure mapping and on the right hand side you will see the result values. As you can see in the example before the RAW_ADD_DATA_T structure is being processed the values of DATA1 and DATA2 fields contain the "pre mapping" prefix and data4 field has a value - "STANDARD".





Step 4



After we click on the DATA2 structure in the Process Step section the mapping for DATA1 and DATA2 fields will be executed and on the right hand side we will get the intermediate result for this small part of mapping execution only (in this case we remove the "pre mapping" part).






Step 5



The next step is to see if the value mapping for DATA4 field is working correctly and in order to do that we need to select the DATA4 field in the Process Step section and then click on the Conversion element of the DATA4 field mapping (conversion from value "STANDARD" to value "P"). This will start the value mapping of the DATA4 field and we will be able to see if the conversion was executed as expected giving the correct result in the right hand side.






I hope this blog has explained the new - Analyzer - feature in a simple way. In the next blogs I will try to show some more new functions of the AIF 3.0.

I`d like to continue last blog

Today i will write something about toolbar enhancement on View3 and View5 in 'Monitoring and Error Handing', TCode: /AIF/ERR.

What is View3 and View5, Maybe some new developers to AIF will have this question, here it is:

View1 is Data message view.

View2 is Data structure view.

View3 is Data view.

View4 is a technical view, you need tick 'technical mode' check box on selection screen, then it will display.

View5 is log message view.


First, let`s enhance View3. In '/AIF/ERROR' package, enhancement spots '/AIF/ERROR_HANDLING'.

1, To create a BADI Implementation:



2, To create a Implementing Class:



  4,  Write your logic in this two method:

         'GET_FUNC_LIST' is used to set the function code,

         'DO_ACTION' is do action when you click button on toolbar.




5, Activate class and BADI, the result on View3:


Second, go to enhance View5.

1, To create BADI Implementation and Implementation class:


2,  Write your own code in below method, GET_ACT_LIST and DO_ACTION is same with View5, used to set  a button on toolbar and response it:



3, Activate Class and BADI, result like below, the new added button on toolbar of View5,


  When you double click the line item:



Actually, each BADI have it`s own example implementation,  it`s very easy if you take a look at it .

I will soon back for other enhancement. see u.




As of October 2014 the new version of AIF (3.0) is available and with the new version lots of new functionalities are available. One of them is the preprocessing function. This new functionality can be used in two cases:



- in case you'd like to use an SAP standard Enterprise Service but before it's execution you'd like to change some of the fields - perform a mapping (master data lookup for example)


- in case you have a custom Enteprise Service or a simple custom proxy message and you'd like to implement a mapping without changing the existing code


In both cases it would be possible to implement the mapping in the code of the Enterprise Service/proxy either in the BADI/enhancement spot or in the custom proxy's code but why it is better to use the AIF for doing the premapping:


- you don't need to modify the standard object - how can a standard Enterprise Service be still standard if you change it heavily in the BADI/enhancement ? With AIF you can still call the original Enterprise Service in a second interface without using the new mapping


- BADIs/Enhancements are very often implemented in multiple places of the Enterprise Services or custom proxies and if we want to be able to govern the interfaces easily we should put all mappings in the same place (AIF structure mapping step)


What are the required steps to use the new functionality:


Step 1



Select the preprecessing checkbox in the interface definition of your AIF interface: SPRO - Interface Development - Define Interfaces





Step 2



Next you need to create a mapping: SPRO - Interface Development - Define Structure Mappings.

Select the source and destination structures of your Enterprise Service - in this case it's going to be the same structure. As a next step you can implement a field mapping where you can use the AIF value mapping table to change the values of the fields from your interface.






Only those two steps are required to implement the new functionality, now when you send the new message with the use of this interface the mapping step will be performed as a first step before the standard Enterprise Service gets called.



In the next blogs I will try to show some more new functions of the AIF 3.0.

Value conversion in SAP interface communication – architectural thinking

This article discusses the SAP technologies and key points that need to be addressed when an SAP solution is needed for value conversion in business process integration scenarios across systems. The article is based on SAP recommendations which have been enriched with additional architectural key points. The first part of the article explains value conversion in general. The next chapter discusses SAP technologies for value conversion. The third chapter analyzes architectural key points of value conversion that need to be taken into consideration. In the last chapter, the SAP technologies are explained in different architecture scenarios which are based on SAP’s recommendations and the key points discussed in chapter three.


Value conversion basics

Many different types of IT systems can still be found in many organizations. Each system contains its own data and semantics, especially in enterprises that are spread across multiple companies and geographies. Problems are likely to occur when data is exchanged between these systems via interfaces.


A simple example of a value conversion issue could be the representation of country codes in different systems. One system could use the letter “D” for Germany and another uses the common notation “GER”. When data including country codes is exchanged between these systems, the operations will fail because the systems do not work with different representations except their own. A mechanism is needed to convert the sender value to the expected receiver value. This kind of value mapping is classified as a functional value conversion, because the content is critical for correct transactional processing inside each system.


Other value conversions, such as the conversion of system names, are needed only for technical reasons. This type of mapping can be technically necessary to enable communication between the sender and receiver system. The functional departments are not concerned about these types of technical details. They will also not feel responsible if errors occur in this type of mapping. The separation between technical and functional value mapping is important when we discuss different value mapping approaches later on.


The definition of one single representation of a value (e.g. unique customer numbers) in the whole company could be considered a solution from an architectural point of view which would make value conversion unnecessary. In practice, this is often not applicable, however, because each business unit is interested in keeping its own representation in its system. Making changes would also incur additional costs and the users would need to get used to the new representation. In a worst case scenario, it would be impossible to make any changes for certain terms as they are hard-coded by a third-party vendor. In such cases, another solution will be needed for value conversions.


This section briefly discussed what “value conversion” is about and why a concept is needed to handle it. The next chapter explains the technologies that SAP recommends.



SAP Technologies

In this section, we discuss the SAP Process Integration (PI) and SAP Application Interface Framework (AIF). Both are intended to connect interfaces with each other and both explicitly provide value conversion functionality. Other SAP middleware products, such as SAP gateway, are not discussed here because they do not focus mainly on interface integration and value mapping.


PI is the middleware which is able to deal with different technologies (like file, SOAP, RFC, etc.) and the mapping of different interfaces on message type level. The middleware seems to be designated for message transformation and value conversion. The source system sends data to the middleware, maps the values (e.g. from “D” to “GER”), and delivers the message to the receiver.

SAP PI provides different standard concepts that can be used to map values between interfaces. These concepts, which are “Fix values”, “Value Mapping”, “Value Mapping Mass Replication” and “RFC look-Up”, will be discussed briefly.


Figure 1 SAP PI as a middleware.png

Figure 1: SAP PI as a middleware


The most basic option in PI is “Fix Values”. The value pair is entered and used for the specific target field mapping only within the enterprise service repository (design time). The value pair cannot be re-used in other message mappings or target field mappings. Maintenance and look-up of the value pairs are done in PI because no mass upload of values is possible. You can only enter source and target values and there is a 1:1 relationship between them. This option is recommended if you only want to map very few values by hand and the mapping is not to be re-used in other message mappings. The following figure shows a “Fix Value” example in PI.


Figure 2 Fix Values.png


Figure 2: Fix value in SAP PI


“Value Mapping” is another more complex option in PI. The value pair is entered in the integration directory (configuration time) and not directly in the target field mapping, like fix values. It can be re-used in all message mappings. Maintenance and look-up of the value pairs are done in PI. The creation of value mapping pairs is done manually and you need to specify additional meta-data, such as scheme, agency, and a context, for each individual value, which requires a sophisticated naming convention. Inside the Enterprise Service Repository (ESR) in the target field mapping, you must enter the source scheme and source agency of the source value and the target scheme and target agency for the target value. You must also define the context.

All values that belong together are classified as a “Value Mapping group.” In this group, there is no predefined source and target value. You can convert values in both directions based on the semantics that you use for source and target scheme and agency in the target field mapping. Compared to fix values, you can have more than two values in one group.

The following table is an example of a representation of the same person, Mr. Smith, in different systems:







System A


Mr Smith


System B




System C



Table 1:  Entity representation with value mapping


Based on the determination for context, agency, scheme and source value, the looked-up target value may differ.


“Value Mapping Mass Replication” is an extension of “Value Mapping”. Mass upload of value pairs is done via java inbound interfaces on PI. This allows any back-end system to store and maintain value pairs which can then be replicated to PI.

It is impossible to replicate values from PI Cache to the back-end. Only back-end to PI replication is possible.

Caution: Back-end and PI Cache should always be in sync. If the conversion rule base is updated in the back-end, the information needs to be replicated to PI. In the meantime, the value mapping cache in PI will not be up-to-date. If interfaces are running during this timeframe, inconsistency and false mappings may occur.


When using “RFC Look-up”, the value mapping pairs are saved in a back-end system.

During run-time, the value mapping pairs are looked up dynamically in the back-end.

The look-up API supports RFC, SOAP und JDBC.

The inbound and outbound interfaces of the look-up need to be configured in the ESR.

The communication channels also need to be set up in the Integration Directory.


PI is one solution in which data conversion can be converted. SAP also introduced AIF as another technology which is an add-on that is to be installed on each SAP back-end system. It enables interface development, monitoring and error handling. The functionality of the framework is performed before the actual inbound or outbound interface is executed in the SAP back-end system during run-time.



Figure 3 AIF and PI.png

Figure 3: SAP AIF combined with SAP PI


This SAP framework provides functionality to implement value conversion in interfaces without or with very little coding effort via customizing transactions. These value mapping objects point to different SAP tables which are to be looked-up during run-time to retrieve the value needed. If a more complex mapping rule is needed, a custom function module can be developed and called by AIF to do the conversion. Another advantage is the re-use of value mapping objects in several interfaces. AIF even provides advanced error handling capabilities such as automated notifications and mass correction, which are also useful in correcting value conversion errors. The error notifications can be directed to different users based on their roles to speed up error correction and reduce coordination effort. That allows the functional end-user to do the correction directly. Mass correction of the same type of error in several messages can be done to make things easier. AIF can be combined with SAP PI, but it can also be used alone. Because AIF is only to be installed on each SAP back-end system, AIF cannot be used in pure non-SAP scenarios that only involve legacy systems. The AIF interface development, functional mapping and monitoring functionality complements the interface transformation, technical mapping and routing functionality of PI.



Requirements for a value mapping architecture

When developing a solution for value conversion, the following points need to be taken into consideration before choosing the appropriate SAP technology:


System landscape: Are SAP systems involved? AIF cannot be used in a scenario that involves only non-SAP systems. Nevertheless, PI can always be used as a middleware technology. If value conversion has already been implemented in PI for such scenarios, it might be appropriate to re-use it in scenarios where SAP systems are involved instead of re-implementing value mapping in AIF, if it is introduced afterwards. On the other hand, if there is at least one SAP system involved per scenario, you can consider moving functional value mapping to AIF.

SAP recommends that AIF be designed for functional value mapping, functional error correction and user notification. PI is designed for message transformation of different interfaces, message conversion of different protocols and routing of messages to different target systems. Technical interface monitoring is also to be done in PI.

This recommendation makes sense as both technologies have strengths and weaknesses and can be combined in an effective manner.


Maintenance: Who should maintain the value conversions? The technical team is responsible for IT-systems, like the middleware. Typically, IT teams do not update functional conversion rules. They expect the functional departments to maintain these values because it is their area of responsibility. However, the functional departments do not want to work with any other system besides their own. They consider another system, such as a middleware engine, to be an additional burden and double work. A solution is needed which is acceptable for both departments, functional and IT. This again emphasizes the split between technical and functional mapping rules for which each department is responsible. If AIF and PI are combined, then PI should attend to technical conversions and AIF functional.


Possession of data: As described, an easy solution would be to save the value conversions directly in the middleware. Other solutions would be to save the conversions rules in the sender or receiving system. It could also be possible to replicate conversion rules between several systems. In the end, the concept must take into consideration who the owner of the conversion rules is and who is responsible for updating them. A master system needs to be defined. The master system should be the system that is to be used over the long-term.


Interface dependencies: There can be situations in which dependencies between interfaces must be considered. Let’s say there are two interfaces between two ERP systems. One interface replicates vendor master data and the other vendor account payable bookings. Critical for the target system is that the vendor number of the sender is always converted to the vendor number of the receiver system, as they have different number ranges. If a booking is passed before the vendor master data was replicated, the booking might fail because the vendor number does not exist yet in the target system. Even if the vendor master data was replicated before, the conversion rule must be updated first, before the other interface is executed. This means that if PI contains the conversion rule, it needs to be updated with the new vendor master data by the receiving ERP system before it can process the interface.


Timeliness of data: The example involving the vendor master data demonstrates that the conversion rule base must always be up-to-date in order to be able to execute other interfaces successfully. On the other hand, country codes are rather static as they do not change very often. In this case, a solution might be sufficient by which the conversion rule base is not updated that often.


Performance: Performance is very important in cases where the end-user expects real-time processing. Other scenarios do not demand high performance, e. g. when data is replicated at night and the user expects the updates the next day. A middleware usually leads to more processing overhead and less performance. The performance drops even more when the middleware also needs to do look-ups in other systems, e.g. to find a conversion rule for country codes.


Re-usability: When the conversion rule base is replicated between several systems there is redundancy and always a risk in terms of obsolete data. Implementing a central conversion rule base eliminates redundancy and increases re-usability. However, it might lead to worse performance because each conversion request needs to be routed to the central conversion rule base. The non-functional requirements need to be taken into consideration here and the right trade-off between performance and redundancy needs to be evaluated.


Error handling: How errors are handled represents an important aspect. A distinction is made between functional errors (wrong values) and technical errors (incompatible message types). A decision must be made as to who is responsible for certain types of errors and how they should be corrected. Audit requirements, e.g. for financial bookings, demand transparency in this process which usually results in a copy of the original broken message. Especially when it comes to defining role-based error handling, one must distinguish between technical and functional errors.


Development effort: Different solutions for value conversions also mean different degrees of effort for implementation. This must be taken into consideration during evaluation to find a solution that is worthy of being implemented. The more SAP technologies are used and combined, the higher the costs for implementation, licenses and operations.


SAP architectures

When considering the architectures of several systems that communicate with each other, we must distinguish between a middleware and a point-to-point architecture.


In a point-to-point connection, the sender and the receiver systems communicate with each other directly, without PI. If the number of interfaces increases, point-to-point connections will be difficult to maintain. A middleware often reduces both the effort and the costs. Nevertheless, point-to-point connections still often exist because they do not generate additional overhead compared to a middleware. Point-to-point connections usually result in very good performance. In terms of conversion rules, either one or both systems may establish a conversion rule base. As for communication that involves SAP, the AIF is designated for such scenarios. It still allows for high performance and conversion for inbound and outbound interfaces. When communication between two SAP systems takes place, one system needs to be defined as the master and do the value mapping. The systems also remain autonomous and the users do not have to work with additional systems. To reduce redundancy, as few as possible systems should contain the conversion rule base.



Figure 4: Point-to-point connections


By using PI as a middleware, the central mapping instance is highly re-usable, but the performance is worse compared to point-to-point. The middleware needs to be maintained with the conversion rules, which can lead to more effort compared to local implementation with AIF, for example. When PI is used and SAP back-ends are involved, AIF can also be used, which is what SAP recommends. As both technologies enable interface development and operations, one needs to discuss whether tasks can be split usefully, especially because value mapping is available in both products. The technical IT is usually aware of technical mappings and they also maintain the technical system details. It makes sense to assign responsibility for the technical mapping to them and execute it in PI directly. On the other hand, functional mapping rules are usually defined in the back-end systems that the functional departments responsible use.



Figure 5: SAP PI as central middleware



Implementing a value mapping concept in SAP is a complex topic that needs to take several key points into consideration. Different scenarios are possible depending on the requirements and the usage of SAP PI and/or AIF. Ideally, SAP PI and AIF are combined to differentiate between technical and functional value conversion and to allow for role-based error handling. If only one of them is used, another approach will be needed. Also, different value mapping concepts can be applied within PI. Each one has strengths and weaknesses which need to be evaluated for the problem statement. The following table shows where specific types of mapping should take place.



PI only

AIF only


Functional mapping




Technical mapping




Table 2: Usage of SAP PI and AIF


The following table also shows the difference between PI and AIF in terms of value conversion as well as the advantages and disadvantages of each mapping concept in PI:




Mapping with AIF only

Fix Values in PI

Value Mapping in PI

Value Mapping Replication in PI

RFC Look-up in PI

SAP Standard




PI only

Back-end custom development

PI only

Back-end custom development







Development effort

Low - Middle

Very low




Re-usability of values in message mapping

Limited – non-central approach





Amount of pairs to be handled






Default exception handling when no matching value was found

No restrictions

  • Pass original source value to receiver
  • Set default value
  • Throw exception

Accuracy of data

Always up-to-date

Need to be updated by hand

Depending on replication interval, data can be outdated

Always up-to-date

Conversion rule







Table 3: Overall recommendation


  • You have some basic knowledge of AIF
  • You would like to implement your custom functionality in toolbar
  • You are a ABAPer.

There are two alternative approaches to achieve this:

Ⅰ. Through the custom configure,

      1, To copy the standard status '/AIF/ERROR_HANDLING_TRANS/0300' to your 'Z' status, add your custom function code.


      2, To copy the standard 'Action handler' class '/AIF/CL_AIF_ACTION_HANDLER' to your 'Z' class.

          Add a method, keep name with 'ON_[FunctionCode]_[Number]' format, number means the view number,

          you can find similar method in this class. For my example, the method name is 'ON_SIMU_0'.


      3, To open the 'Define Applications' in /n/AIF/CUST. To replace 'Action handler' with your 'Z' class, type your custom status here.


     4, When you click the button on toolbar in /n/AIF/ERR, Result will be like this:


Ⅱ. Through BADI.

     1, You can easily find there are some useful enhancement spots in '/AIF/ERROR' package,

         what we wanted is '/AIF/V1_ACT' BADI. Also you can implement other BADI which works for other view.

         To create a enhancement implementation,


     2, and create a BADI implementation under it.


     3, 'GET_FUNC_LIST' is used to set the function code,

         'DO_ACTION' is do action when you click button,




     4, When you click the button on toolbar in /n/AIF/ERR, Result will be like this:



You will find it is more flexible using BADI to achieve same functionality, due to you can according values in 'AIF KEYS'

to decide this interface whether have this toolbar button.

This is my first blog, hope it`s useful, Please feel free give me suggestion or comments.


Best regards,


SAP AIF provides robust error handling mechanism along with Alert Notification where Alerts can be triggered to specific Recipient in case of Application Error. However, sometimes it is required to distribute the alerts to different Recipients based on who sent the message (e.g. If Sender system is ‘SenderSys1’ then Alert should be triggered to “Recipient1”).


SAP AIF Provides key field based Recipient determination for this purpose. This document explains steps to configure key field based recipient determination.


Step1: Define Index table containing the field on which you need to raise alert: Copy /AIF/STD_IDX_TBL into interface specific index table (e.g. Y0001_IDX_TBL). Add required Key Field on which routing needs to be defined (e.g. Sender System)




Step is only required if field on which recipient is determined is not available in AIF’s standard index table /AIF/STD_IDX_TBL.


Step 2: Assign Index table to your interface





Step 3: Define Alert recipient table by copying /AIF/T_ALRT_DEF


This table will be used to identify routing conditions for determining Recipients.




Step 4: Define different Recipients (Error Handling ->Namespace Specific Features ->Define Recipients)




Step 5: Assign different users to Recipients (System Configuration ->Assign Recipeints)



Step 6: Populate the table with different Recipients based on Key Fields value:




Step 7: Use custom Alert recipient table in Error Handling -> Namespace Specific Features ->Configure Alerts. Recipients will be identified based on this table by supplying key fields from Source message.



Assign appropriate alert category to be used.

Step 8: Define key field and assign that as to be used in Alert Recipient Determination in Error Handling -> Interface Specific Features.




After this configuration, if you execute your message and if it fails , Alert will be triggered to specific recipient based on Sender System. This can be changed to any particular fields from Payload (e.g. Company code or Department).


Limitation: Key Field based Alert determination is not allowed when Multi. Selection Type is selected as “Multiple Selection” (i.e. the data messages are selected from the multiple index table)



In /AIF/IDOC_GEN, you work with IDoc Types which start with "/". 1.png

You might get error message like "Separator '/' for namespace not paired or in wrong position" below.


This is due to that "/" as a special character should only be in the first place if it is contained in a structure name. Don’t worry! /AIF/IDOC_GEN has provided you an option to solve this issue. You can proceed with the next step by clicking below Continue button.

2 - Copy.png


Then you will see below screen for your confirmation.


Try to replace all "/" with "_" in Raw Data Structure column and press F8 to continue, you will succeed in generating the objects.



Filter Blog

By author: By date:
By tag: