• ERP Finance Transformation
  • melnizams@gmail.com

Leverage FI Posting App using SAP Integration Suite and AIF

This guide explores the power of SAP CPI (Cloud Integration Suite) IFlows to automate and streamline financial data integration from CSV files to SAP HANA, using a series of steps that involve importing, transforming, and integrating data.

SAP Integration Suite Dashboard

CPI Iflow Process with CSV input

Import

The IFlow begins by importing CSV data files from an SFTP server. Data is retrieved and prepared for further processing.

Transform

Next, the data is transformed from CSV format to XML and then to JSON. This ensures compatibility with SAP HANA and facilitates data processing.

Integrate

The JSON data is then integrated into SAP HANA using a REST call. This allows for seamless data exchange between the IFlow and SAP HANA.

Create

Finally, the IFlow utilizes the data in SAP HANA to create finance documents. This automates the creation of financial records based on imported data.

ZRTR_GL_POST_JOURNAL_ENTRIES IFlow Diagram

CPI Iflow Process with SOAP input

Import

The IFlow begins by receiving incoming data through a SOAP sender adapter. This allows external systems to trigger the integration process and send data for further processing.

Transform

The incoming SOAP data is converted from XML to JSON format. This transformation ensures compatibility with SAP HANA and prepares the data for further integration steps.

Integrate

The JSON data is then integrated into SAP HANA using a REST call. This allows for seamless data exchange between the IFlow and SAP HANA.

Create

Finally, the IFlow utilizes the data in SAP HANA to create finance documents. This automates the creation of financial records based on imported data.

SOAP Integration IFlow Diagram

CSV to XML Transformation

ZRTR_GL_POST_JOURNAL_ENTRIES IFlow Diagram

File is saved as CSV. SAP CPI will use the following XSD file to transform the CSV file into XML format

ZRTR_GL_POST_JOURNAL_ENTRIES IFlow Diagram

CSV to XML standard action parameters :

ZRTR_GL_POST_JOURNAL_ENTRIES IFlow Diagram

Logging : Set SAP_ApplicationID with the reference

Groovy script : By setting SAP_ApplicationID, the user can search the messages by the reference field.

ZRTR_GL_POST_JOURNAL_ENTRIES IFlow Diagram

Calling SAP HANA via REST

REST API Call

The IFlow utilizes the REST adapter to send a POST request to a defined REST endpoint in SAP HANA, sending the converted JSON data.

Data Transmission

The REST API call transmits the JSON data over a secure network connection to the SAP HANA database, ensuring data integrity.

Response Handling

The IFlow processes the response from SAP HANA, checking for successful data reception and handling any potential errors or warnings.

SAP HANA REST API Integration

ABAP Logic for CPI to AIF Data Transfer

The incoming data from SAP CPI (Cloud Platform Integration) is seamlessly transferred to the SAP AIF (Application Interface Framework) through custom-developed ABAP code. The code leverages an XML enabler instance to process and transform the data before calling the transfer_to_aif method.

ZRTR_GL_POST_JOURNAL_ENTRIES IFlow Diagram

Creating Finance Documents in SAP AIF

1

Data Mapping

The receiver program in SAP, maps the data to the relevant fields within the finance document structure in the SAP system.

2

Document Posting

The created finance document undergoes validation to ensure it conforms to SAP's rules and regulations, guaranteeing data integrity and compliance.

In SAP, the financial documents are created by SAP AIF, Application Interface Framework. AIF enables integration between SAP systems and external applications. In this case, the IFlow provides data to AIF, which then uses this data to create the finance documents.

The AIF acts as a bridge between the external data and SAP's internal finance document creation process. This allows for seamless data transfer and automated document creation.

SAP AIF Error Handling Monitor