Blog > How to create a single index table in SAP AIF?

How to create a single index table in SAP AIF?

SAP_AIF_How_to_create_single_index_table_Nowak
Mateusz Nowak SAP Integration Consultant, SAP Press Author
icon__calendar 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_TBLAt the end of the table add additional field representing purchase order number.

 

Single Index table in SAP AIF

Single Index table in SAP AIF – created based on a template

 

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

SAP AIF – Namespace Specific Entries for Single Index Table

 

Now from the AIF Customizing open  Define InterfaceSpecific 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

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.

Mateusz Nowak SAP Integration Consultant, SAP Press Author
SAP Integration consultant since 2016. Mateusz is the author of SAP Press Book: Interface Monitoring and Error Handling with SAP AIF. He's also a trainer in the openSAP course Virtualize and Automate Your SAP Testing Using Int4 IFTT. Matt has been involved in multiple integrational projects as ABAP Developer, AIF lead and consultant. Skilled at a variety of tools and development techniques including ABAP, AIF, PO, BRFplus, IDocs, Adobe Forms, Smartforms, IDocs, ALE, SCPI.