Skip to Content
Product Information
Author's profile photo Zaheer DAWZI

SAP ERP Solution unit onboarding guide for e-Invoicing in KSA

Preface

As part of the phase 2 e-Invoicing process, The Zakat, Tax and Custom Authority (ZATCA) requires its taxpayers to onboard their Electronic Invoice Generation Solutions onto the ZATCA’s e-Invoicing portal.

In the solution for onboarding, we have systemized and simplified this process for our on-premise and cloud-based customers. Following is the stepwise representation of the onboarding process to be followed in SAP ECC, SAP S/4HANA on premise and SAP S/4HANA cloud.

High level Process Steps

The following process step diagram represents the high-level process sequence that is followed for onboarding the taxpayer’s solution ID.

Definitions

eInvoice generating solution unit (EGS)

This is a unique GUID of the taxpayers eInvoice generating solution. Taxpayers can consider one system as EGS or could also consider multiple logical separations within one physical system that generates the eDocuments and each of such separations is also called as EGS. In our solution, we consider the following parameters to create multiple unique logical units within one physical ERP unit to uniquely create a EGS unit.

  • Company code
  • Source type
  • Invoice type

Every EGS needs to be onboarded with ZATCA to submit the eDocuments generated in its logical unit and each EGS will have its own Invoice counter value (ICV).

 Table showing the different combinations possible for the creation of EGS in a company code.

 

Company code

Organizational unit for accounting.

Source type

This defines the source module in which the source document of an eDocument is created. For example, the source of SD billing document is SD_INVOICE (Billing Document) and for an invoice created directly in FI is FI_INVOICE (Accounting Document). For self-billing invoice, the source type is INV_VERIF (Invoice Verification – self billing).

Invoice type

These are the two broad classification of eDocuments as per ZATCA, i.e., Standard tax invoice and simplified tax invoice.

Compliance CSID (CCSID)

This is a cryptographic stamp identifier that is provided by ZATCA for only for performing the compliance checks.

Production CSID (CSID)

This is a CSID provided by ZATCA upon request after compliance checks are successfully completed. Every EGS unit has one unique production CSID. This is like your boarding pass of your flight journey 🙂. once you have received this it means you are good to kick off with the document submission to ZATCA.

Process Flowchart

Following is the detailed process flowchart that is defined in the solution for the onboarding process.

Onboarding programs in the solution

Following onboarding programs are built to manage the complete taxpayer onboarding process.

 

Transaction name Transaction code
Generate Solution Unit ID SAEGSG
Manage Solution Unit ID SAEGSM
Generate Cryptographic Stamp Id. SACSIDG

 

Generate Solution Unit ID

With this transaction, you can generate unique EGS units. As defined above, we have prefixed the parameters for which unique EGS units can be generated.

In this report, you will by default see all the possible combinations for the selected company codes for which you can generate the EGS unit ID by simply selecting the records and clicking on Generate solution ID button. depending on your business scenario, you need to select only the applicable combinations and create the EGS.

For multiple company codes selected in the selection screen of this report, you also can select the leading company code among them. In case a leading company code exists, the parameter value company name is copied from the leading company code. Please maintain in this company code, the organization name registered with ZATCA.

Manage Solution Unit ID

With this transaction, currently you can delete incorrectly created EGS units for which CCSID is not yet assigned by ZATCA. i.e., for example, you incorrectly selected an unnecessary entry in the generate solution ID report for which you already created the EGS GUID and later when you consider not to proceed with further steps and create a CCSID so you can delete this EGS unit ID in this transaction and create the correct one if required using Generate Solution Unit ID report.

Generate Cryptographic Stamp Id.

With this transaction, you can manage all the remaining onboarding process. i.e., further to the creation of the EGS unit GUID, as a next step you need to create the compliance CSID to perform the compliance checks.

The following functions that can be performed in this transaction are explained in its sequence of occurrence.

  • Request CCSID
  • Check Compliance
  • Request CSID

 Request CCSID:

For the selected EGS unit in this report you can click on the request CCSID button to request the Compliance Cryptographic stamp identifier from ZATCA. This step is a prerequisite to perform the compliance check.

Immediately after you click on the Request CSID button, you will be asked to enter the OTP that is generated from ZATCA ERD portal. The OTP needs to be manually generated by the taxpayer and the same needs to be entered in this report.

This report will then request ZATCA for the compliance CSID by sending the CSR generated with reference to the selected EGS unit through the API /compliance. The status of the EGS unit will then be updated with the status code “CCSID_REC – CCSID is received”

 

Check Compliance

As part of the onboarding process, the taxpayer needs to check for the compliance of the document types in the ZATCA Fatoora portal before it can start submitting the eDocuments to the Fatoora platform. This report facilitates in doing this function with the click of the button “Check Compliance” in this report.

When you click it, the system sends the sample static eDocument of the relevant invoice type for which the EGS unit is generated to ZATCA through Compliance check API /compliance/invoices and checks the compliance of the same. When the check is successful, the API returns the response code 200 upon successful check and returns the CCSID that can be used only for compliance checks.

In case of errors, this API returns the response code 400 when the entered OTP is wrong or if the subject compliant document submitted is not as per ZATCA standards. It returns response code 500 when the service at ZATCA end has any internal server error.

Further to receiving the response from ZATCA, this report allows to perform the next step in the process.

If the response code is 200, The status of the EGS unit is then updated with the status code “CCSID_COMP – CCSID Compliance check is completed

 

Request CSID

This functionality in the report will request with ZATCA for the production CSID that needs to be used to interface the production documents with ZATCA’s Fatoora portal.

This button calls the API /production/csids and in return captures the CSID returned by ZATCA.

The status of the EGS unit will then be updated with the status code “CSID_REC – CSID is received”.

 

Set the Effective start date

ZATCA informs its taxpayers at least 6 months in advance to kickstart the submission of the eDocuments to comply with the phase 2 regulation.

In our solution, we have provided a configuration to set this start date of eDocuments submission as effective start date of the integration for each relevant company code defined for KSA.

With this setting, the eDocument cockpit understands that the company code is ready to start the document submission from this date and stops the creation of eDocuments in the generation phase and starts creating them in the integration phase for the source documents created from and after this effective date. This from regulation perspective means that until this date, the taxpayer will remain in phase 1 i.e., generation phase.

Please ensure that SAP note 3236978 is implemented in your system to set the effective date.

Note:

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

 

Customizing path

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

Considerations to update the effective start date:

 

Process diagram showing key considerations in updating the effective date.

  • Update of the effective date to a historical date is not allowed.
  • Update of the effective date to a future date is allowed only in the below case.
  • If the current date < the existing/new effective date in the system, then any future date from the current date can be maintained.
  • If the current date >= the existing effective date in the system and no eDocuments are created under the new submission process, then any future date from the current date can be maintained.

That is all about onboarding. now you are all set to start submitting the documents to ZATCA.

I hope this blog is very informative. Please share your feedback and questions.

Other blogs on KSA eInvoicing

Master data mapping in KSA eInvoicing solution | SAP Blogs

Some useful links

Note: For accessing the last three links listed above you need to login to MENA Localization SIG – Overview (sapjam.com)

Assigned Tags

      7 Comments
      You must be Logged on to comment or reply to a post.
      Author's profile photo Mahmoud Abdulwahab
      Mahmoud Abdulwahab

      Dear Zaheer ,

       

      Thank you for your helpful detailed post .

      I have maintained all steps till compliance check successfully then faced an error during request CSID

      E:EDOCUMENT_SA:000 The public key of the CA Reply is different from t

      Message no. EDOCUMENT_SA000

      SAP_REQUEST_CSID

       

      SAP_REQUEST_CSID

      Author's profile photo Zaheer DAWZI
      Zaheer DAWZI
      Blog Post Author

      Dear AbdulWahab,

      Please raise a support ticket in the software component : CA-GTF-CSC-EDO-SA with the error screenshots.

       

      Regards,

      zaheer

      Author's profile photo Firoz Ashraf
      Firoz Ashraf

      Dear Abdulwahab,

      How did you solve this?

       

      Regards,

      Firoz Ashraf

      Author's profile photo Naresh Kumar S
      Naresh Kumar S

      Hi Zaheer,

      Great Document!!

      Can we known, what all the changes need to be performed from the QR code level for the KSA E invoicing phase 2,

      Because from phase 2 we are having the following TAGS in the QR code

      • Hash of XML invoice.
      • ECDSA signature.
      • ECDSA public key.
      • ECDSA signature of the cryptographic stamp’s public key.

      Then is there any blog or links to implement and test the QR Codes, for phase 1 we have used VAT QR Code application to test the QR Codes.

      thanks for the support.

      Author's profile photo Firoz Ashraf
      Firoz Ashraf

      Hi Zaheer,

      Excellent blog !

      While doing the first step in onboarding using transaction code SAEGSG I am getting the following error:

      Org. Unit/Free Text is empty for company code 1234

      Message No. EDOCUMENT_SA000

      When I debugged the program, found that entry for BUKRS = 1234, PARTY = SATAXN is missing in table T001Z

      Any idea how to maintain this entry?

       

      Regards,

      Firoz Ashraf

      Author's profile photo Zaheer DAWZI
      Zaheer DAWZI
      Blog Post Author

      Hi Firoz,

      Thank you for your comments Smile

      Please read the blog Master data mapping in KSA eInvoicing solution | SAP Blogs.

      Under the section - Master data specific to onboarding this is explained.

      Regards,

      Zaheer

      Author's profile photo Firoz Ashraf
      Firoz Ashraf

      Many Thanks Zaheer,

      We implemented SAP Note 3212218 - Company code additional parameters for KSA E-invoicing

      This note created additional parameters SATAXN, SAINDU and SASEID.

      Next, we maintained the values of these parameters in SE16 table T001Z against the company code.

      This solved our problem.

      Warm Regards,

      Firoz Ashraf