How to create Custom Functions in SAP AIF?

Custom functions in SAP AIF (SAP Application Interface Framework) can enhance and speed up your process of monitoring messages and business documents related to the messages.

In this post, I will show you how to quickly create a custom function for inbound sales order interface, that redirects you to Display Sales Order transaction and allows preview of the created Sales Document.

It is possible to create a custom function in two ways: in /AIF/CUST_FUNC transaction and directly in the Monitor and Error Handling.


Create Custom functions in SAP AIF in transaction /AIF/CUST_FUNC

The first method – the creation of custom function by transaction code gives us the opportunity to adjust it in a more complex way.

In order to create a custom function for your interface go to transaction /n/AIF/CUST_FUNC and provide your namespace, interface name and interface version.

In new Window select New Entries.

Then provide Function Text, Function Tooltip, Function Icon, Message ID, Message Number.
I will use Message ID V1 with message number 311, that informs about type and number of the document, that has been created.

Then choose Skip First Screen and Start in New Session checkboxes. As Custom function type choose Transaction and VA03 as URL. We want to make this custom function visible for all users and only for selected messages in the interface that we provided in the beginning. The final result should look exactly like it’s visible on the below screen:




Creation of the custom function in AIF in transaction /AIF/CUST_FUNC
Creation of the custom function in AIF in transaction /AIF/CUST_FUNC


Save the entry and go to Define Parameter IDs and Values Node and choose New Entries.

In parameter ID you have to provide parameter ID from the VA03 transaction: AUN, that represents Sales Order number. In the message number 311 from V1 ID, the sales order number is stored in variable &2 and that is why you have to choose MSGVAR2 as message variable.

Save the entry and assign it to transport request.

How to creae custom function in SAP AIF directly in AIF Monitor and Error Handling?

The second options for doing the same can be done directly in the /AIF/ERR transaction.

The only thing you have to do is to open Error Handling window for the specific interface. Then highlight the specific message in Log Messages and from the menu choose Customize à Custom Functions.

Then provide the information as it is shown on the screenshot below:

Custom Functions in SAP AIF creation directly in Error Handling View
Custom Functions in SAP AIF creation directly in Error Handling View


Now in AIF Monitoring and Error Handling in Log Messages for this specific message you will see a function with the icon you provided.

Once you click on it, you will be redirected to the VA03 transaction and Sales Order 38450 will be displayed.

Displaying Sales Order by using Custom Function in SAP AIF
Displaying Sales Order by using Custom Function in SAP AIF


This is a very simple trick, that can make working with AIF more pleasant!

Have you ever used custom functions? Do you prefer to maintain it from the transaction code or directly from Monitor and Error Handling window?

SAP developer and integration consultant since 2016. Involved in several international projects as ABAP developer, AIF developer and integration consultant. Skilled at a variety of tools and development techniques including OOP in ABAP, Process Observer, Application Interface Framework (AIF), Process Orchestration, BRFplus, Alerts, Proxy, Smartforms, Adobe Forms, SAPscripts, BAdIs, Enhancement Framework, IDocs, ALE and SAP eDocument Framework.Up-to-date and advanced ABAP programming knowledge. Experienced with SAP AIF. Very well organized, focused on the customer and business. Creative thinker, quick to get results.



ul. Bednarska 1
60-571 Poznan, Poland



Write to us