Integrating ZATCA with SAP S4 HANA

Looking to integrate ZATCA with SAP Business One? This guide will walk you through the process step by step, ensuring a smooth and successful integration.

Ajith Kumar M
July 30, 2023
11 min

Sign up for E-Invoicing Newsletter

The latest industry news, technologies and resources.
We care about your data in our privacy policy.
Thank you! Your submission has been received!
Oops! Something went wrong while submitting the form.

Guess what? We're back with the latest update on our exciting e-invoicing journey! We've been working hard to make things even smoother and more efficient for our business, and we can't wait to share the good news with you.

We're thrilled about the bright future ahead with our newly integrated ZATCA and SAP S4 HANA's E-Invoice Workflow. Stay tuned for more updates, and thank you for being a part of our journey!

This integration works like magic, streamlining our invoicing process. Handling invoices, tracking transactions, and staying compliant with regulations are now a breeze. Say goodbye to headaches – it's all smooth sailing from here on out!

Role of Middleware in ZATCA Integration:

Middleware plays a crucial role in integrating SAP S4 HANA with ZATCA for seamless e-invoicing compliance. Powered by, this middleware utilizes powerful APIs to achieve a seamless integration with ZATCA, enabling various e-invoicing functions effortlessly.

During phase 2 of the e-Invoicing process, The Zakat, Tax, and Customs Authority (ZATCA) mandates taxpayers to integrate their Electronic Invoice Generation Solutions with ZATCA's e-Invoicing portal.

A Step-by-Step Onboarding Guide for e-Invoicing in KSA with SAP ERP Solution

To make the onboarding process easier for both our on-premise and cloud-based customers, SAP have systematized the entire procedure. Below are the step-by-step instructions for the onboarding process in SAP ECC, SAP S/4HANA on-premise, and SAP S/4HANA cloud:

If you are using SAP ECC:

Step 1: Access the onboarding section in your SAP ECC system.

Step 2: Follow the provided instructions to integrate your Electronic Invoice Generation Solution with ZATCA's e-Invoicing portal.

If you are using SAP S/4HANA on-premise:

Step 1: Navigate to the onboarding section within your SAP S/4HANA on-premise system.

Step 2: Follow the provided guidelines to connect your Electronic Invoice Generation Solution to ZATCA's e-Invoicing portal.

If you are using SAP S/4HANA cloud:

Step 1: Go to the onboarding section in your SAP S/4HANA cloud system.

Step 2: Adhere to the given instructions to integrate your Electronic Invoice Generation Solution with ZATCA's e-Invoicing portal.

The high-level process steps for onboarding the taxpayer's solution ID are illustrated in the following process step diagram. It represents the sequential flow of the onboarding process.

The eInvoice generating solution unit (EGS) is identified by a unique GUID that corresponds to the taxpayers' eInvoice generating solution. Taxpayers have the flexibility to treat one system as an EGS, or they can partition a single physical system into multiple logical units, each functioning as a separate EGS responsible for generating the eDocuments. In our solution, we establish distinct logical units within a single physical ERP unit using the following parameters to create unique EGS units:

  • Company code
  • Source type
  • Invoice type

To comply with ZATCA's requirements, each EGS must undergo the onboarding process. This ensures that the eDocuments generated within its logical unit can be submitted to ZATCA. Furthermore, every EGS will have its own unique Invoice counter value (ICV).

In the following table, you'll find the multiple variations to create EGS within a company code.

The Company code represents the organizational unit used for accounting purposes within the system.

Source type is a parameter that identifies the source module responsible for generating the source document of an eDocument. For example, SD_INVOICE (Billing Document) is used as the source type for an eDocument generated from an SD billing document, while FI_INVOICE (Accounting Document) is used for an invoice created directly in the FI module. Additionally, INV_VERIF (Invoice Verification - self-billing) is the source type for self-billing invoices.

Invoice type encompasses the two primary classifications of eDocuments as defined by ZATCA: Standard tax invoices and simplified tax invoices.

Compliance CSID (CCSID) is a cryptographic stamp identifier issued by ZATCA solely for performing compliance checks.

Production CSID (CSID) is obtained from ZATCA upon successful completion of compliance checks. Each EGS unit is assigned a unique production CSID, which serves as a confirmation for initiating the document submission process to ZATCA, similar to a boarding pass for a flight journey.

The solution includes a detailed process flowchart that outlines the step-by-step onboarding process, providing a clear and comprehensive guide for users.

The solution incorporates a set of onboarding programs designed to oversee the entire taxpayer onboarding process efficiently.

Generate Solution Unit ID:

In this process, you can create unique EGS (eInvoice Generating Solution) units. The system displays all the possible combinations for selected company codes, and by simply clicking the "Generate Solution ID" button after selecting the relevant records, you can generate the EGS unit ID. Depending on your business needs, you can choose only the combinations that are applicable to create the EGS units.

For multiple company codes, you can also designate a leading company code among them. If a leading company code exists, the system will use its company name as a reference. Ensure that the organization name registered with ZATCA is maintained in this company code.

Manage Solution Unit ID:

This section allows you to delete incorrectly created EGS units for which a CCSID has not been assigned by ZATCA. For example, if you mistakenly selected unnecessary entries in the "Generate Solution ID" report and created the EGS GUID, but later decide not to proceed, you can use this section to delete the EGS unit ID. If needed, you can then create the correct one using the "Generate Solution Unit ID" report.

Generate Cryptographic Stamp Id:

This part manages the remaining onboarding process after generating the EGS unit GUID. The next step is to create the compliance CSID (Cryptographic Stamp Identifier) required for compliance checks.

The following functions can be performed in this section:

Request CCSID: By clicking the "Request CCSID" button for the selected EGS unit, you can obtain the Compliance Cryptographic stamp identifier from ZATCA. This step is necessary for performing the compliance check. You will need to manually enter the OTP (One-Time Password) generated from ZATCA ERD portal.

Check Compliance: This function enables you to check the compliance of document types in the ZATCA Fatoora portal before submitting eDocuments. By clicking the "Check Compliance" button, the system sends a sample static eDocument of the relevant invoice type for the generated EGS unit to ZATCA. The system verifies compliance, and if successful, the CCSID can be used only for compliance checks.

Request CSID: In this step, the system sends a request to ZATCA for the production CSID, which is needed to interface production documents with ZATCA's Fatoora portal. The system captures the CSID returned by ZATCA and updates the EGS unit status as "CSID_REC – CSID is received."

Deactivation of EGS:

If you need to change your company VAT number due to incorrect data or receiving a new VAT number, you must deactivate all active EGS units per company code. This feature is available in the "Manage Solution Unit ID" (SAEGSM) report. Please be aware that deactivation is irreversible.


Before deactivating an existing active EGS unit, make sure to:

Manually deactivate the CSID in ZATCA's Fatoora portal, as deactivation in SAP does not automatically deactivate the CSID in ZATCA's system.

Process (submit or cancel) all unprocessed eDocuments with the same VAT number as the EGS you wish to deactivate.

Implement SAP notes: 3258406 & 3269459 to activate this feature.

Set the Effective Start Date:

ZATCA notifies its taxpayers at least 6 months in advance to begin eDocument submission in compliance with phase 2 regulations. The solution provides a configuration to set the start date of eDocument submission as the effective start date of integration for each relevant company code in KSA.

Setting this date allows the eDocument cockpit to recognize when the company code is ready to start document submission. The system stops creating eDocuments in the generation phase and starts creating them in the integration phase for source documents generated on or after the effective date. Until this date, the taxpayer remains in phase 1 (generation phase).

To set the effective date, ensure SAP note 3236978 is implemented in your system.


Maintaining the effective start date is a prerequisite to start document submission.

Customizing Path:

To access the required settings, navigate through the following path in the system:

Cross-Application Components > General Application Functions > Document and Reporting Compliance > Country/Region-Specific Settings > Saudi Arabia – Maintain Effective Date of Integration with Tax Authority.

Factors to take into account when updating the effective start date:

The e-invoice generation process within SAP S4 HANA ERP is designed to maximize efficiency, covering key stages such as invoice generation, e-invoice conversion, PDF A/3 generation, and seamless email distribution of invoices, all within the SAP S4 HANA platform. Users can effortlessly perform these actions without the need for external logins, ensuring a frictionless experience. The end-to-end e-invoice generation and ZATCA approval flow occur instantly, empowering users to take prompt actions without delays.

Two methods enable e-invoice generation triggers in SAP S4 HANA. Firstly, users can manually select pending invoices and click "Generate E-Invoice" for immediate processing. Secondly, the system automatically generates e-invoices upon invoice creation or approval within the ERP.

Important Update Regarding Effective Date:

Please note that updating the effective date to a historical date is not permitted. However, you are allowed to update the effective date to a future date under specific conditions:

If the current date is earlier than the existing/new effective date in the system, you can set any future date from the current date.

If the current date is on or after the existing effective date in the system, and no documents have been created under the new submission process, you can set any future date from the current date.

With these guidelines, you are all set to begin the onboarding process and start submitting your documents to ZATCA.

We hope this information proves valuable to you. Please feel free to share your feedback or any questions you may have. Your input is highly appreciated. The Preferred Option for Zatca e-Invoicing, Over SAP Integration

Are you currently using the SAP ERP In-built Zatca E-invoicing system, but finding it lacking in advanced features? Look no further! Experience a remarkable transformation with - the ultimate solution that takes e-invoicing to a whole new level.

Let's talk about the seamless integration of with SAP S4 HANA and ZATCA. This dependable middleware flawlessly connects your SAP S4 HANA system with ZATCA, simplifying the registration process for multiple ERP/POS systems and obtaining cryptographic stamps for each device. This means you can enjoy a compliant invoicing process without any complexities or hassles.

One of the standout features of is its remarkable automation and streamlining of the entire invoice generation process. Bid farewell to manual data entry and the risk of errors. With, you can effortlessly generate Zatca-compliant e-invoices, saving valuable time and ensuring utmost accuracy. This automated approach not only ensures compliance but also boosts your business's efficiency, allowing you to focus on growth and innovation.

Integration is seamless and stress-free with Our platform smoothly integrates with your existing systems, eliminating the need for complex software installations or disruptive workflow changes. Transitioning to is a breeze, ensuring a seamless continuation of your operations.

Real-time monitoring and validation are critical to maintaining Zatca compliance, and excels in this aspect. With our platform's real-time monitoring features, you can rest assured that your e-invoices consistently meet Zatca's stringent requirements. Any potential errors or non-compliance issues are swiftly flagged, allowing for immediate corrective action. Embrace a worry-free invoicing process with, reducing the risk of compliance-related penalties.

Data security is paramount, and at, we take it seriously. Your sensitive financial information is protected by robust security measures, including encryption and stringent access controls. With, your data remains safeguarded at all times, giving you peace of mind and confidence in the integrity of your information.

Key Features for the e-Invoicing Middleware:'s e-invoicing middleware offers a range of essential features, including:

RESTful APIs: The middleware provides RESTful APIs that enable smooth integration with any ERP/POS system, with minimal modifications required.

Support for All Document Types: A single API supports various document types, ensuring adaptability and scalability in the e-invoicing process.

Uninterrupted Connection:'s middleware ensures a consistent and uninterrupted connection with ZATCA, ensuring reliable data transmission.

Error-Free e-Invoice Generation: The middleware employs 150+ smart data validations to ensure adherence to ZATCA regulations, minimizing errors in invoices.

Comprehensive Data Inclusion: Mandatory fields, such as invoice hash, previous invoice hash, UUID, invoice counter value, and QR code, are automatically generated.

XML Format Conversion:'s middleware swiftly converts invoice data into ZATCA-specified UBL 2.1 schema in XML format.

Cloud-based Storage: Invoice data is securely archived on SLA-based cloud servers for at-least six years, complying with data retention requirements.'s Integration with SAP S4 HANA and ZATCA: acts as a dependable middleware, seamlessly connecting SAP S4 HANA with the ZATCA system for flawless e-invoicing compliance. The API integration simplifies the registration process for numerous ERP/POS systems with ZATCA, obtaining cryptographic stamps for each device, and ensuring a compliant invoicing process.

Don't miss out on the opportunity to revolutionize your e-invoicing experience. Visit our product and witness firsthand the additional features and exceptional support that offers. Request a demo today and elevate your e-invoicing efficiency to new heights!

Contact Us:

📞 WhatsApp or call us at +91 8778237303

📧 Email:

📺 Subscribe to our YouTube channel for informative content and updates: YouTube Channel:

We look forward to your participation and helping you navigate the world of ZATCA invoicing with ease! ✨