How to create a single index table in SAP AIF?

Int4 Team
2018-05-28

Single index table in SAP AIF

Have you ever heard about single index table in SAP AIF? Have you ever encountered the issue while you were looking for a specific message in Monitoring and Error Handling? Let’s imagine the situation, that you receive tons of inbound messages every single day and you want to find a message with a specific purchase order number in your AIF Interface, but you don’t know what is the AIF message ID that contains this specific Purchase Order number.

Here, single index table in SAP AIF with custom selection screen for the interface come to help us!

In this post, I will guide you how to create a select index table, create a module pool program and configure index table and the selection screen for the inbound sales order interface in SAP AIF.

How to create Single Index table?

First of all, we have to create a single index table by copying template table: /AIF/STD_IDX_TBL. At the end of the table add additional field representing purchase order number.

Single Index table in SAP AIF

Selection Screen preparation

Now go to SE38 transaction code and create module pool program type, that will be used for selection screen extension in AIF Monitor and Error Handling.

Please see the code snippet you can use for your program:

PROGRAM ZAIF_SEL_SCREEN_0001.
DATA: gv_po_num TYPE bstkd.

SELECTION-SCREEN BEGIN OF SCREEN 0001 AS SUBSCREEN.
SELECT-OPTIONS:
s_po FOR gv_po_num.
SELECTION-SCREEN END OF SCREEN 0001.

AT SELECTION-SCREEN OUTPUT.
/aif/cl_global_tools=>get_value_from_mem( ).

SAP AIF Customization steps

Now go to  Define Namespace-Specific Features in AIF Customizing. Make an entry as shown in the below screenshot:

SAP AIF - Namespace Specific Entries for Single Index Table

Now from the AIF Customizing open  Define Interface-Specific features and in node Define Key Fields for Multi. Search make an entry as below, where BSTKD is a key field name in your Index Table and S_PO is your parameter from selection program. E1EDK01-BELNR will be the source field.

SAP AIF - Interface Specific entries necessary for Single Index Table

Congratulations! Right now you can go to AIF Monitor and Error Handling and search messages by specific Purchase Order Number
Want to learn more about indexing in SAP AIF? Check other articles about SAP AIF on Int4 blog.