SAP AIF – Custom Functions creation
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.
How to 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:
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 create 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:
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.
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?