Blog > Michal’s Tips: AIF 3.0 – preprocessing function

Michal’s Tips: AIF 3.0 – preprocessing function

Michał Krawczyk SAP Mentor, SAP Press Author
icon__calendar 2014-12-25

SAP AIF 3.0 – new functionalities

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

SAP AIF – premapping

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)

AIF 3.0 – preprocessing function

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
Define Interface

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.

Define Structure Mappings

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 on the Int4 blog, I will try to show some more new functions of the AIF 3.0.

Michał Krawczyk SAP Mentor, SAP Press Author
SAP integration consultant since 2004. He has been recognized by SAP included becoming an SAP Mentor in 2007 and winning the top contributor/topic leader award from SDN (SAP Developer Network portal) in SAP PO/PI eight times. Michal is the author many SAP integration related books: Mastering idoc business scenarios with SAP XI , Mastering idoc business scenarios with SAP PI (second edition).

Contact us

If for any reason, the thought of reaching out to us has crossed your mind, then by all means do not hesitate to get in touch with us, as we are more than happy to put to rest all of your concerns.