ShapeNXT Logo
Back to all articles
Enterprise Scenarios

SFTP to OData Integration in SAP CPI with Payload Mapping

Step-by-step walkthrough of building an end-to-end SFTP to SAP S/4HANA OData iFlow. Includes CSV-to-XML conversion, splitter, and payload mapping.

S
Senior SAP Integration ArchitectPublished on March 5, 2026
7 min read
SFTP to OData Integration in SAP CPI with Payload Mapping
Live Project Training & Certification

Want hands-on live project training? Download the 2026 ShapeNXT Syllabus.

Go beyond theory. Build 10+ production-grade enterprise iFlows, master Groovy scripting, and practice on live BTP sandboxes with direct 1-on-1 architect mentorship.

4.8 / 5 Rating (1500+ Learners)• 92% Placement Success
Explore Course

The Scenario: Legacy Files to Cloud ERP

A classic enterprise integration challenge: an external warehouse or billing vendor drops comma-separated (CSV) records onto a secure SFTP server every night. Your job is to ingest these records, validate them, convert them into business documents, and post them directly into SAP S/4HANA Cloud using standard OData APIs.

Step 1: SFTP Sender Adapter Configuration

Configure the SFTP adapter with the following production best practices:

  • Directory & File Name: /inbound/orders/*.csv
  • Handling: Set to Delete File or Move to Archive Directory to prevent accidental re-processing loops.
  • Authentication: Always prefer Public Key Authentication (SSH Key in Security Material) over username/password.
  • Polling Interval: 15 minutes or specific cron scheduling.

Step 2: CSV to XML Transformation

Because SAP CPI's graphical mapping tool natively processes hierarchical XML structures, the incoming CSV byte stream must be converted. Use the standard CSV to XML Converter palette component. Provide your record schema definition (Root Name, Record Name, and Delimiter ,).

Step 3: Handling Batching with the Iterating Splitter

If the vendor drops a file with 10,000 order lines, sending one massive request can overwhelm the receiver. Place an Iterating Splitter configured with XPath //Orders/OrderRecord. Enable Stop on First Error or wrap it in a local process for transactional recovery.

Step 4: Message Mapping to OData Schema

Download the standard EDMX/XSD schema for the target S/4HANA OData service (e.g., API_SALES_ORDER_SRV). Connect your source fields to the OData entity set:

  • Source CustomerID → Target SoldToParty
  • Source MaterialSKU → Target Material
  • Source RequestedQty → Target RequestedQuantity

Step 5: OData Receiver Adapter Setup

Configure the OData V2 adapter with:

  • Address: https://my-s4hana.s4hana.ondemand.com/sap/opu/odata/sap/API_SALES_ORDER_SRV
  • Operation: POST (Create)
  • CSRF Protection: Checked (SAP CPI automatically handles the token fetch and subsequent POST call).
Live Project Training & Certification

Want hands-on live project training? Download the 2026 ShapeNXT Syllabus.

Go beyond theory. Build 10+ production-grade enterprise iFlows, master Groovy scripting, and practice on live BTP sandboxes with direct 1-on-1 architect mentorship.

4.8 / 5 Rating (1500+ Learners)• 92% Placement Success
Explore Course