Interface Creation for Logging Synchronous Service Calls

SAP Application Interface Framework provides an API that can be used by applications to log synchronous service calls.

To log synchronous service calls, you must create an ABAP Dictionary structure, define a new interface, and specify the engine settings, as described in the following steps.

Creating an ABAP Dictionary Structure for the Interface

Use transaction SE11 to create a new ABAP Dictionary structure. The structure must represent the input and output of your service call.

Developing the Interface

Go to transaction /AIF/CUST and perform the following configuration steps.

  1. Navigate to Start of the navigation pathSAP Application Interface Framework Next navigation step Interface Development Next navigation step Define InterfacesEnd of the navigation path.

  2. Enter the name of the namespace.

  3. Create a new entry. Specify the following parameters for interface development:

    Parameter

    Description

    Interface Name

    Enter the name of the interface to be monitored.

    Interface Version

    Enter the interface version.

    Description

    Enter a meaningful description.

    Lifetime of Application Log

    Enter the number of days messages are stored in the application log (for example, 90d).

    SAP Data Structure

    Select the ABAP Dictionary structure created before.

    Raw Data Structure

    Select the ABAP Dictionary structure created before.

    Direction

    Choose Inbound.

  4. Save the interface.

After defining your interface, specify the engine settings for it in the following way:

  1. Go to transaction /AIF/CUST.

  2. Navigate to Start of the navigation pathSAP Application Interface Framework Next navigation step Interface Development Next navigation step Additional Interface Properties Next navigation step Specify Interface EnginesEnd of the navigation path.

  3. Select your interface.

  4. Change Application Engine to Sync log application engine.

  5. Change Persistence Engine to Sync log persistency engine.

  6. Save your settings.

Implementation

The following coding example shows the basic implementation steps.

If you can't specify the interface, it's determined at runtime using the data type of the raw data structure. If multiple interfaces are defined for the same raw data structure and the sync log application engine, you must implement BAdI /AIF/SELECT_IF_SYNC_LOG of enhancement spot /AIF/ENHS_SYNC_LOG_API. This step is required to uniquely determine the interface to be used.

Since restart isn't defined for synchronous calls, no restart feature is available by default. If you want to implement a restart feature, implement BAdI /AIF/RESTART_SYNC_MSG of enhancement spot /AIF/ENHS_SYNC_LOG_API.

When you cancel your message in the monitoring application, the status of the message is set to Cancelled. You can implement additional application features in BAdI /AIF/CANCEL_SYNC_MSG of enhancement spot /AIF/ENHS_SYNC_LOG_API.