Skip to content

SAP ECC and S/4HANA

Applies to: e-Invoice · e-Way Bill · Which modules do I have?

Purpose

Connect SAP to Complifly: where to trigger the outbound call, which SAP structures supply the required fields, the mapping traps specific to SAP, and how compliance outcomes return to the billing document.

Audience

SAP integration developers and implementation consultants.

Prerequisites

  • The Integration Pattern — read first; only SAP-specific matters appear here
  • SAP developer effort allocated, with a named person
  • Sandbox credentials
  • Raw sample output per document type, from SAP itself

Verify: Whether Complifly supplies a certified SAP add-on or this is an integration pattern you implement is not established in this portal. Confirm before quoting effort. Recorded as assumption F1 in the Assumptions Register.

Steps

1. Choose the trigger point

Option Suits Note
Output determination on the billing document Most implementations Fires at release-to-accounting; the natural point
Middleware subscription Landscapes with an integration platform The platform usually already provides retry and monitoring
Scheduled batch job Lower volume, or where real-time is not needed Simplest, but delays discovery of rejections

Trigger after the billing document is complete and released. Sending earlier produces documents that are later changed in SAP, which cannot be changed at the government once registered.

2. Choose the transport

Transport Note
Direct outbound HTTP from SAP Fewest moving parts. Needs outbound connectivity from the SAP system
Through the integration platform Preferred where one exists — retry, monitoring and credential handling are already solved
File-based Fallback where SAP cannot call out at all

Where an integration platform is in use, put the Complifly call behind it. Do not duplicate retry logic that the platform already provides.

3. Source the required fields

Complifly needs Typically from
Document number and date Billing document header
Document type Billing type, translated by a lookup rule
Supplier registration and address The plant or business place assigned to the document
Buyer registration and address The customer master's tax and address data
Place of supply Determined in SAP — it is a tax position and remains SAP's
Values Billing document conditions
Line details Billing document items
Classification codes Material master or its tax classification
Dispatch-from, where different Plant address

Once you know where each value lives, build the translation in the product rather than in ERP code: Build a Mapping Template walks through creating the template, loading these fields from a sample, and dragging them onto their NIC counterparts with the right direct, date or lookup rule.

4. Handle the SAP-specific mapping traps

These are the ones that consume time on an SAP integration:

Trap Symptom Fix
Business place versus plant Wrong supplier registration on the document Establish which object actually carries the registration in this landscape. It differs by implementation
Billing type mapping Documents route to the wrong pipeline A lookup rule per billing type, with a default that fails rather than guessing
Date and time zone Dates a day out SAP dates are date-only; confirm the time-zone convention before mapping
Amount scaling Values out by a factor Confirm decimal handling for currencies without minor units
Leading zeros Codes rejected as malformed Classification codes and state codes must retain leading zeros — SAP numeric handling strips them
Condition types Tax amounts wrong Map from the correct condition types, agreed with the SAP tax consultant
Cancelled documents Sending a reversed document Exclude reversals from the trigger, or send them as the correct document type

The leading-zeros trap is the most common and the least obvious: the value looks right in SAP and arrives one character short.

5. Return the outcome to SAP

Pull the write-back feed on a schedule and store the reference number against the billing document.

Store Where
Reference number and acknowledgement Against the billing document, in a custom field or a dedicated table
Signed QR data Where printing happens in SAP
e-Way Bill number and validity Against the delivery or the billing document
Failure reason Somewhere a person will see it

If printing happens in SAP rather than in Complifly, the signed QR must reach the SAP print form. Establish this early — it changes what the ERP must store.

6. Handle rejections visibly

Create a work item, a workflow task, or a report that a person reviews daily. A rejection stored only in a table is a rejection nobody acts on, and the document never becomes compliant.

Validation

Beyond the pattern's checks, verify these SAP-specific points:

Check Method Pass condition
Correct registration on every document Send from several plants or business places Each carries the right supplier registration
Billing types map correctly Send one of each type in use Each routes to the intended pipeline
Leading zeros preserved Inspect classification and state codes in the mapped payload Full length, zeros intact
Dates correct Send a document dated the fifth of March Stored as intended, not transposed
Amounts correct Compare the mapped payload against the SAP document Exact match
Reversals excluded Reverse a billing document It is not sent, or is sent as the correct type
Multi-line correct Send a document with several items Every line present with correct values
Outcome reaches SAP Complete one document end to end The reference number is visible against the billing document
Printing works If printing in SAP, print one The signed QR renders and scans from paper
Rejections visible Force a rejection A person sees it the same day

Troubleshooting

Symptom Cause Action
Rejected as an unauthorised registration Supplier registration sourced from the wrong SAP object Confirm whether the business place or the plant carries it in this landscape
Classification code rejected as malformed Leading zeros stripped Preserve them as text through the whole chain
All documents become tax invoices Billing-type lookup default too permissive Use a default that fails rather than guesses
Dates a day out Time-zone convention not settled Confirm and correct the mapping
Tax amounts wrong Wrong condition types mapped Agree the condition mapping with the SAP tax consultant
Duplicate rejections Documents sent twice, or the SAP number range restarted Check the trigger's idempotency and the number range
Reversed documents registered Reversals not excluded from the trigger Exclude or reclassify them. A registered document cannot be un-registered
The reference number never reaches SAP Write-back not consumed, or the consumer stopped Check the flag, the subscription, then the consumer
SAP print form lacks the QR The signed QR data is not stored in SAP Store it during write-back consumption
Rejections accumulate unseen No work item or report Create one and assign an owner
Integration stops silently No SAP-side monitoring Alert when documents sent falls to zero during business hours