EDI and KSeF in SAP

EDI and KSeF in SAP in line with new legal obligations

Automated exchange of documents between ERP systems via EDI (Electronic Data Interchange) has for years been the foundation of logistics and finance processes in many large companies. However, the introduction of the National e-Invoicing System (KSeF) enforces fundamental changes in this area. The new system requires that every invoice be sent to the central government platform and assigned an identification number before it can be delivered to the recipient. This means that the traditional EDI process must be reconsidered and adapted to the new requirements.

EDI and KSeF in SAP – learn about the requirements and solutions.

This article presents how to effectively combine the automation of EDI interfaces with the new KSeF architecture using the example of an SAP implementation. We discuss challenges, integration scenarios, and best practices that help avoid operational risks.

The classic EDI scenario before KSeF

Before the introduction of KSeF, many companies relied on direct invoice exchange via EDI interfaces. The invoice was generated in the ERP system (e.g., SAP SD), then automatically converted into an EDI format (e.g., EDIFACT, XML, CSV), and sent to the business partner.

The process was fast, automated, and required no additional intervention. Business partners received documents immediately, supporting workflow efficiency and shortening the receivables cycle.

EDI and KSeF. KSeF requirements and the interruption of classic EDI

New legal regulations concerning KSeF require that every invoice be sent to the central government platform, where it is verified and assigned a KSeF identifier. Only such an invoice can be legally considered issued.

This means that:

  • invoices should no longer be sent directly to business partners via EDI before being assigned a KSeF number,
  • the process of generating EDI / IDoc messages and sending them must take into account the moment of invoice processing by KSeF,
  • the impact of using the KSeF offline mode on EDI transmission from SAP must be considered.

HAERGI solution: holding EDI until invoice approval

To maintain EDI automation while ensuring compliance with regulations, HAERGI implemented a delayed EDI sending mechanism:

  • The invoice is generated in SAP SD and saved as a sales document,
  • The document is sent to the KSeF transaction and transferred to the government system,
  • After receiving the KSeF number, the document is marked as ready for further processing,
  • Only then is the EDI interface activated and sends the document to the business partner along with the KSeF number.

This mechanism allows full automation of the process while ensuring compliance with KSeF.

Technical aspects of integrating EDI and KSeF

The HAERGI solution is based on a flexible approach to EDI interface configuration:

  • a new field containing the KSeF invoice number is added to EDI packages,
  • EDI transmission is blocked until positive validation by KSeF,
  • the EDI interface does not require structural changes, since the KSeF number is placed in optional fields.

EDI and KSeF: edge cases and best practices

Implementation requires attention to several key elements:

  • Duplicate numbers: the KSeF system rejects invoices with the same document number,
  • Diverse requirements: some recipients still expect invoices via traditional channels even after KSeF implementation,
  • External warehouse systems: require synchronization of the order completion moment with the document submission to KSeF.

Best practices:

  • monitoring KSeF status and automatic rejection notifications,
  • regular testing in the demo environment before SAP updates,
  • logging of the EDI process and KSeF transmissions in separate logs,
  • documenting the process and training both IT and accounting teams.

How does the new EDI process look from the user’s perspective?

From the SAP user’s perspective:

  • the sales document is created in the SD module in the standard way (no changes),
  • exchange with KSeF occurs in the background or interactively (depending on configuration),
  • once accepted by KSeF, the document receives a KSeF number and is sent via EDI,
  • process history and logs are available in a dedicated monitoring transaction.

Thus, there is no need for the user to engage in the new operational stage.

EDI and KSeF: a consistent process, lower risk, compliance with regulations

Integrating EDI with KSeF in the SAP system enables the preservation of efficiency and automation of the invoicing process while complying with new legal requirements.

The HAERGI solution ensures independence, the ability to perform self-diagnosis, and control over every stage. This approach not only minimizes risks but also guarantees that business partners receive invoices in full compliance with regulations.

SEE HOW WE CAN DIGITALIZE YOUR BUSINESS

Let's meet on social media: