File Adapter

Use

The file adapter supports the upload of files to the SAP Application Interface Framework, where they are processed and can be monitored by business users. You can read a file or files from different locations and map their content into raw structures of an interface.

Prerequisites

You have created interfaces in Customizing for the SAP Application Interface Framework under Start of the navigation pathInterface Development Next navigation step Define InterfacesEnd of the navigation path.

Features

Customizing

In Customizing for the SAP Application Interface Framework under Start of the navigation pathSystem Configuration Next navigation step Configure File AdapterEnd of the navigation path, you determine how the file data is mapped into raw structures.

To read a file from the file system, the minimum you need to specify is the following:

  • File Type

    Specify one of the following:

    • Text file

    • Binary file (for example, Microsoft Excel)

  • File Content

    Specify one of the following:

    • Flat structure

    • Complex structure

      The file content can be mapped into a complex structure, which may contain header, substructures, and sub tables.

    • XML

      Mapping is done via XSLT or ST (Simple Transformation). The transformation name must be stored in the Transformation field.

    • User defined

      Customer-specific mapping can be done via a customer-specific function module, the name of which has to be stored in the Mapping Function field. The /AIF/LFA_MAP_USER_SPEC_TEMPL function module template is delivered.

    • Excel (.xlsx)

      You can define mapping and conversions in the file adapter Customizing. The mapping can be done automatically or using a detailed mapping table.

Depending on the file content, you need to make several mandatory settings as follows:

File Content

Text Type

Length of Type Determination Value

Transformation

Mapping Function

Complex Structure

You must select a text type

You must enter a value

   

Flat

You must select a text type

You must enter a value

   

XML

   

You must enter a transformation name

 

User defined

     

You must enter a customer-specific function module

Excel (.xlsx)

       

For mapping, you need to specify at least a raw structure that describes the resulting data type (for example, a BAPI structure).

Upload Files to the SAP Application Interface Framework

Use the Uploading Files to AIF report (transaction /AIF/LFA_UPLOAD_FILE ) to transfer individual files and to map them to a raw structure. You can access the report from the SAP Easy Access menu under Start of the navigation pathSAP Application Interface Framework Next navigation step File UploadEnd of the navigation path.

The report provides the following features:

  • Access files from a client PC or from the application server.

  • Specify the file location either directly or using logical files (for more information, see transaction FILE).

  • Split large data files into smaller blocks.

  • Specify the use of the queues of the persistency runtime configuration.

  • Have the file and the result structure displayed after upload.

Read Files from a Folder and Send to the SAP Application Interface Framework

Use the Reading Files from a Folder and Sending Them to AIF report (transaction /AIF/LFA_CHECK_SEND) to transfer and map multiple files into the SAP Application Interface Framework. You can access the report from the SAP Easy Access menu under Start of the navigation pathSAP Application Interface Framework Next navigation step Administration Next navigation step Tools Next navigation step Mass File Upload from ServerEnd of the navigation path.

The report provides the following special features:

  • Access files from the application server only.

  • After a successfully transfer, automatically move the files to another folder to avoid multiple selections and transfers of the same files.

Download Excel Files from the SAP Application Interface Framework

In the SAP Application Interface Framework, you can use the file adapter to upload Excel files, to merge data into Excel files you have uploaded, and to download these enhanced Excel files.

This function has the following features:

  • Use the file adapter reports to upload existing Excel spreadsheets

  • An SAP Application Interface Framework interface processes the data from an uploaded Excel file

  • An action is called at the end of processing and triggers the download of the data via a second interface and the XML enabler

  • In the second interface, an action is called at the end of processing that generates the output Excel file. To generate the Excel file, you can use the /AIF/LFA_EXCEL_DOWN_MERGE function module as an action function.

In Customizing for the SAP Application Interface Framework under Start of the navigation pathSystem Configuration Next navigation step Configure File AdapterEnd of the navigation path, you specify the raw data structure that contains the output settings for downloading files.

Monitoring

Use the Log of File Adapter report (transaction /AIF/SHOW_BLOCK) to monitor the progress and success of file uploads done by the SAP Application Interface file adapter.

The report provides the following features:

  • Select files by ID, standard interface file name, user, date, or configuration namespace and ID.

  • Display logs and performance details on file and block level.