Technology Blogs by SAP
Learn how to extend and personalize SAP applications. Follow the SAP technology blog for insights into SAP BTP, ABAP, SAP Analytics Cloud, SAP HANA, and more.
cancel
Showing results for 
Search instead for 
Did you mean: 
brittamangei
Product and Topic Expert
Product and Topic Expert
12,006
Since the release of 1709 AIF is better integrated into RFC technology (t/q/bgRFC)which makes it now possible to easier monitor RFC message. The AIF - RFC integration was completely reworked. The old functionality to set up an AIF RFC interface is no longer used and parts of it have been deactivated.

Note: if you have an old AIF RFC interface it is still possible to use this interface. The functionality of the interface is not affected by the new AIF RFC integration.

This blog describes how to set up an AIF interface to monitor RFC messages.

How does it work?


To monitor asynchronous RFC messages you need to follow some steps to enable AIF.

1. Create a DDIC structure resampling the interface of the to be monitored function module


AIF requires DDIC structures to be able to display message content in the AIF monitoring apps. The DDIC structure needs to contain one component for each parameter of the to be monitored function module.

2. Develop AIF interface


Some AIF customizing is required. An AIF namespace within the AIF interface needs to be created is required. The engines used for the interface need to be specified. It is necessary to use the new xRFC engines. For RFC monitoring one additional step in the customizing needs to be executed - it is necessary to define the RFC settings.

3. Create and Assign RFC specific index table


The RFC integration requires specific fields in the index table. Therefore an own AIF index table is required per AIF interface. The index tables need to contain include /AIF/XRFC_SIDX_DATA_ST.

4. Create and Assign an AIF recipient


To enable the users to see the interface in the monitoring tools an AIF recipient has to be created and needs to be assigned to the AIF interface.

5. (optional) Add log messages to AIF


Per default log messages are not logged for RFC messages and therefore not displayed in AIF monitoring. By calling method /AIF/CL_XRFC_TEMP_STORAGE=>STORE_BAPIRET_TAB it is possible to store and display the log messages.

In the following example the different steps are described in detail.

Example


This example uses a copy of BAPI_FLBOOKING_CREATEFROMDATA to demonstrate the new RFC monitoring of AIF.

1. Create a DDIC structure resampling the interface of the to be monitored function module


AIF requires DDIC structures to be able to display message content in the AIF monitoring apps. The DDIC structure needs to contain one component for each parameter of the to be monitored function module.


The structure can be created via transaction SE11. In this example ZBM_RFC_FLBOOKING_CREATE will be used.

To monitor the function module the structure requires the following components:







































Component Component Type
RESERVE_ONLY S_RESERV
BOOKING_DATA BAPISBONEW
TEST_RUN TESTRUN
AIRLINEID S_CARR_ID
BOOKINGNUMBER S_BOOK_IN
TICKET_PRICE BAPISBOPRI
EXTENSION_IN BAPIPARETAB
RETURN BAPIRET2_T

Save and activate the structure. The structure should look like displayed in the screenshot below:



2. Develop the AIF interface


Create Namespace


Every AIF interface needs to be created in an AIF namespace.

Go to AIF customizing and navigate to SAP Application Interface Framework –> Interface Development –> Define Namespace. Create a new entry and enter a name and description. In this example namespace ZBM_02 is used.


Save the new entry.

Create AIF interface


After creating the AIF namspace the AIF interface to monitor the RFC messages can be created. Go to AIF customizing and navigate to SAP Application Interface Framework –> Interface Development –> Define Interfaces. Enter the name of the AIF namespace created in the step before. Create a new entry. Enter the following data:



































Field Content
Interface Name Name for the AIF interface, in this example: FLBOOKING
Interface Version Interface Version, in this example: 1
Description Meaningful description of you AIF interface
Lifetime of Application Log Number of days that messages from AIF are stored in the application log, in this example: 90
SAP Data Structure The structure created in step one, in this example: ZBM_RFC_FLBOOKING_CREATE
RAW Data Structure The structure created in step one, in this example: ZBM_RFC_FLBOOKING_CREATE
Interface Direction Inbound

The Interface should look like displayed in the screenshot:


Save your AIF interface.

Specify AIF Interface Engines


If you create an AIF interface the default engines used in the interface are set to PROXY. In our case we like to monitor RFC messages and the engines settings have to be adjusted accordingly.

Go to AIF customizing and navigate to SAP Application Interface Framework –> Interface Development –> Additional Interface Properties -> Specify Interface Engines. Select your namespace.

If your AIF namespace contains more than one AIF interface select your interface from the displayed list. If your AIF namespace contains only one AIF interface the entry is directly loaded. The standard setting for Application Engine and Persistence Engine is Proxy. Both entries need to be changed. Change Application Engine to Application Engine xRFC integration and Persistence Engine to Persistency Engine xRFC integration.


Save your changes.

Define RFC settings


In the next step the RFC settings for the new AIF interface have to be maintained.

Go to AIF customizing and navigate to SAP Application Interface Framework –> Interface Development –> Additional Interface Properties -> Define RFC Settings. Create a new entry and enter the relevant data.































Field Content
Function Module The to be monitored function module - in this example: ZBAPI_FLBOOKING_CREATEFROMDATA
Namespace Your namespace - in this example: ZBM_02
Interface Your AIF interface - in this example: FLBOOKING
Version The version of you AIF interface - in this example: 1
Deactivated False
Use temp. msg. store False

The entry should look like displayed in the screenshot:


Save the new entry.

3. Create and Assign RFC specific index table


Create Single Index Table


To monitor RFC messages correctly additional fields are required in the Standard Index Table. Therefore every AIF RFC interface requires a specific index table. It is possible to use table /AIF/XRFC_S_IDX for AIF RFC interfaces - nevertheless it is recommended to create one single index table per AIF interface. The table includes the additionally required fields which are contained in include /AIF/XRFC_SIDX_DATA_ST.

In this example we will create an own index table. We will copy the new index table from table /AIF/XRFC_S_IDX.

Go to transaction SE11 and copy table /AIF/XRFC_S_IDX.


Do not forget to activate the table.

Assign Single Index Table


Now that we have created the table it is necessary to assign the new index table to the AIF interface.

Go to AIF customizing via transaction /AIF/CUST and navigate to SAP Application Interface Framework –> Error Handling -> Define Namespace-Specific Features. Select your namespace.

Create  a new entry under Define Interface-Specific Features.

Enter your interface details and the name of the newly created single index table in field Message Idx Table (in this exmaple: ZBM_RFC_FLBOOK).


Save.

4. Create and Assign an AIF recipient


Create AIF Recipient


To enable AIF to display the RFC messages in the Interface Monitor or the Message Dashboard an AIF recipient is required.
Go to the AIF customizing and navigate to SAP Application Interface Framework -> Error Handling -> Define Namespace-Specific Features. Select your namespace and navigate to Define Recipients on the left hand side of the screen.

Create a new entry. Enter a meaningful recipient name and a description.


Save your changes.

Assign AIF Recipient


To be able to see something in the interface monitor or the message dashboard two assignment steps are necessary:

  1. Assign AIF recipient to AIF interface

  2. Assign users to AIF recipient


In the first step it is necessary to assign the recipient to the AIF interface which should be monitored.
Go to the AIF customizing and navigate to SAP Application Interface Framework -> Error Handling -> Define Interface-Specific Features. Select your namespace, interface name and version.
On the left hand side of the screen navigate to Assign Recipients without Key Fields and create a new entry. Select the namespace and the recipient created in the step before.
Save your changes.


In the second step you have to assign the users who should monitor the IDoc. This can be done via transaction /AIF/RECIPIENTS.

Go to transaction /AIF/RECIPIENTS and select the user name which you want to assign to the recipient.


Create a new entry. Select your namespace and recipient and enter a user number (in this example 10 will be used). Also set the indicator for Include on Overview Screen and Technical User.



Test


If you have followed all above mentioned steps you will be able to monitor RFC messages. You will be able to see if an RFC message was successfully processed or the processing ended with error. Send some test data and check the result in the monitoring and error handling.


At the moment the AIF RFC interface only shows log messages which are raised by MESSAGE E(...) or Message A(...) from the function module. Messages in case of success are not displayed.

To enable AIF to display additional log messages the optional Step 5 needs to be executed.

5. (optional) Add log messages to AIF


AIF provides a feature to display more log message. To add additional log messages to the AIF log method /AIF/CL_XRFC_TEMP_STORAGE=>STORE_BAPIRET_TAB needs to be called in the implementation of the RFC-Function Module.


In addition you need to activate flag 'Use temp. msg. store' in the RFC specific interface settings of AIF. Go to AIF customizing and navigate to SAP Application Interface Framework -> Interface Development -> Additional Interface Properties -> Define RFC Settings. Open the entry for your AIF RFC interface. Set the indicator for field 'Use temp. msg. store'.


Save.

If the RFC call is logged on client-side, the data stored with method /AIF/CL_XRFC_TEMP_STORAGE=>STORE_BAPIRET_T on server-side is read via the same RFC connection with the help of RFC-function module /AIF/READ_BAPIRET_BGRFC_CLIENT or /AIF/READ_BAPIRET_TRFC_CLIENT - depending on the type of RFC call. The user (it is the same user, that is used for RFC all, which is monitored) requires S_RFC authorization for /AIF/READ_BAPIRET_BGRFC_CLIENT or /AIF/READ_BAPIRET_TRFC_CLIENT.

Restriction: If the status of the RFC-Call at the end is success, messages of type E and A are not added to the application log of the corresponding AIF-message.

Test


Send in new messages. If you executed the optional step you will now be able to see additional log messages in the monitoring and error handling.


This blog showed how to set up an AIF interface to monitor t/q/bgRFC messages. If you have questions about the AIF RFC integration feel free to reach out to me.
10 Comments