Case study · SAP integration

Ontex

Producing SAP iDocs from retail sales when the flat-file structure is custom: a format problem where being nearly right is the same as being wrong.

Production system

Engagement
Integration engineering
Platforms
Synchronisation service
Role
Integration design and build
Target
SAP via custom iDoc Verify before publishing
Image placeholder The SAP integration: point-of-sale sales being split into per-sale and consolidated iDoc files, the custom flat-file structure, and the delivery log to the client’s server. assets/portfolio/ontex/featured.png · 16 / 10
Industry
Enterprise operations
Users
Finance and operations teams
Integration
POS sales into SAP
Output
Custom iDoc flat files
Role
Integration engineering
Status
Production

01The business situation

A file format with no room for interpretation.

Ontex, an international personal hygiene group, needed retail sales from Lightspeed Retail R Series to reach its SAP system. SAP accepts iDocs, but this client’s flat-file structure was custom, not the documented default. A file that is close to correct is not partially accepted; it is rejected. And two different shapes were needed at once: an individual document for sales through one channel, and a consolidated document for everything else.

Core challenge

Generate a custom iDoc structure exactly, in two forms, and deliver it somewhere SAP will reliably pick it up.

Before

Retail sales outside the SAP record

  • Manual Extraction
  • Format Mismatch
  • Rejected Files
  • Delayed Posting

After

Sales arriving as valid iDocs, automatically

  • Point of Sale
  • iDoc Generation
  • File Delivery
  • SAP

iDoc Sync Service

02The system at a glance

One pipeline. Four connected parts.

  • Service Interface Generation and delivery activity
  • Sales Ingestion Transactions from the POS
  • iDoc Composition Per-sale and consolidated
  • Delivery Onto the client’s server
Core PlatformExact-format generation and reliable handoff
  • Sales Ingestion
  • Per-sale iDoc
  • Consolidated iDoc
  • Custom Flat-file Format
  • Automated Delivery
  • Processing Handoff

03Workflow 01

Two document shapes from one stream of sales.

Sales through one channel require their own individual iDoc. Everything else is consolidated into a single document. The service decides which is which and composes both from the same incoming stream.

Image placeholder iDoc generation: the incoming sales stream splitting into individual per-sale documents on one path and a consolidated document on the other, with the flat-file structure shown. assets/portfolio/ontex/workflow-idoc.png · 16 / 11
  • Per-sale where requiredSales through the designated channel each produce their own document.
  • Consolidated for the restRemaining sales are combined into a single document rather than generating noise.
  • Custom structure, exactlyThe flat-file layout is bespoke to this client, and the generator implements it precisely.

04Workflow 02

Getting it there is part of getting it right.

A correct file that never arrives is no better than a malformed one. Generated documents are delivered onto the client’s own server, where their SAP process collects them.

  • Delivered, not just producedFiles are transferred to the client’s server as part of the pipeline.
  • A clean boundaryOur responsibility ends where their SAP process begins, which keeps ownership unambiguous.
  • Logged transfersEach delivery is recorded, so a missing document can be traced rather than guessed at.
Image placeholder The delivery step: generated iDoc files queued for transfer, the delivery log with timestamps and outcomes, and the handoff point to the client’s SAP processing. assets/portfolio/ontex/delivery.png · 16 / 10
Image placeholder A generated iDoc file with its custom flat-file structure and the sales it represents. assets/portfolio/ontex/file-detail.png · 1 / 2.04

05Engineering behind the product

The system behind an exact file.

There is not much room for elegance in a format specification. The engineering is in being exactly right, repeatedly.

  • Custom flat-file generation

    The client’s bespoke iDoc structure is implemented precisely, since a nearly-correct file is simply rejected.

  • Dual document strategy

    Sales made through MDware each produce their own iDoc, while remaining sales consolidate into one, from the same stream.

  • Automated file delivery

    Generated documents are transferred to the Ontex FTP server, where their SAP process collects them.

  • Queue-based processing

    Generation and delivery run as background work rather than in a request cycle.

  • Transfer logging

    Deliveries are recorded so an absent document can be traced.

  • Clear system boundary

    The service’s responsibility ends at delivery, keeping ownership between the two sides unambiguous.

06Technical architecture

Under the hood

A Laravel service generating a custom SAP iDoc flat-file structure and delivering it to the client's own server for processing.

Backend

  • Laravel
  • PHP

Output

  • SAP iDoc (custom flat file)
  • Per-sale and consolidated documents

Integrates

  • Lightspeed Retail R Series (source)
  • MDware (channel)
  • Ontex FTP server → SAP (target)

07Delivery journey

How the integration was delivered.

  1. Requirement

    Establish the iDoc structure needed

  2. Format work

    Implement the custom flat-file layout

  3. Split logic

    Per-sale and consolidated rules

  4. Delivery

    Automate transfer to the client server

  5. Testing

    Validate acceptance by SAP

  6. Production

    Release into live operation

  7. Support

    Operate and maintain

The service is in production. Dates, durations and volumes are withheld until confirmed. Verify before publishing

08What the system enabled

What the delivered integration enabled

  • Retail sales delivered into SAP as valid iDocs
  • A bespoke flat-file structure implemented exactly
  • Per-sale and consolidated documents from one stream
  • Automated delivery onto the client’s server
  • Logged transfers that can be traced
  • A clean boundary between the two systems