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

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


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.


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”.


Deactivation of EGS

After you have successfully received the CCSID and the CSID and you then unfortunately have to change your company VAT number because you either previously maintained incorrect VAT number or you have received a new VAT number (though does not happen so often Smile ), you will have to deactivate all the active EGS units per company code and only then you will be able to create new EGS units with the updated VAT number and onboard the same.

This functionality of deactivation of the existing active EGS units is available in the manage solution unit ID (SAEGSM) report.

Deactivation is an irreversible function. so please be mindful about it.


Before deactivating an existing active EGS unit, please ensure the below.

  1. You manually deactivated the CSID in ZATCA’s Fatoora portal. Deactivation of the EGS in SAP does not automatically deactivate the CSID in ZATCA’s system.
  2. Once you deactivate an EGS, you will not be able to submit the unprocessed eDocuments pertaining to such EGS. So, you process (submit or cancel) all the unprocessed eDocuments which have the same VAT number of the EGS you wish to deactivate.

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

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.


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

Handling Intercompany transactions in KSA eInvoicing | SAP Blogs

Some useful links

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

Assigned Tags

      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




      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.




      Author's profile photo Firoz Ashraf
      Firoz Ashraf

      Dear Abdulwahab,

      How did you solve this?



      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?



      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.



      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

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

      Good to know Ashraf.

      Author's profile photo Sai Thunga
      Sai Thunga

      Hi Zaheer,


      WE have implemented OSS note 3212218. However, SASEID & SATAXN are not available in Company Code additional details even after implementing the OSS note 3212218.

      Please advise.




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

      Hi Sai,

      This is the note that makes these parameters available at company code level. please ensure that the post implementation steps are completed as well. you will see the description of these parameters at the company code level.



      Author's profile photo Srinivas Taduka
      Srinivas Taduka

      Hi Zaheer,


      Thank you for the blog!!

      We stuck at onboarding the solution unit id. I had a call with ZATCA technical team for help, they mentioned about CSR needs to be sent in order to receive a CCSID.

      Also, we are having an issue with the service interface ( eDocSACSIDOperations ). Please see the error details below.


      Error analysis
      The statement
      "MOVE deepStruc1 TO deepStruc2"
      requires the operands "deepStruc2" and "deepStruc1" to be compatible.
      Compatibility means equivalence in the context of
      ABAP/4 type checking.

      In this case, the condition is not satisfied: The operand "deepStruc2" has the
      the type "v" and the length 328, but the operand "deepStruc1" has the type
      and the length 336.

      Kindly help.


      Thank You,

      Srinivas T


      Author's profile photo Tomasz Pasierbski
      Tomasz Pasierbski

      Dear Zaheer and Colleagues,

      We got stuck during registration of CCSID to ZATCA Simulation system.

      After Solution Unit ID was created in our test SAP system (version S4 Hana with integration via SAP CI) we tried to Request for CCSID in tcode SACSIDG - but every time once we enter valid OTP code, then we receive a message "Unauthorized".

      In SAP CI we can find a message 401 "Unauthorized" in the log - but we don't see any issues on SAP side. Our ZATCA account is valid and authorized in Fatoorah portal.

      It looks like the message 401 occurs in SAP CI internally during calling SAP CI API before sending a message to ZATCA.

      Would it be possible to be caused by the fact that our SAP runs on servers from Europe? Is it required to run it on local Saudi system?

      Have any of you met similar error? Do you have any supposition on the root cause?

      Thank you for any support.

      Best regards,


      Author's profile photo Shunyashish Mohanty
      Shunyashish Mohanty

      Hi Tomasz,

      Please add the role (ESBMESSAGING.SEND) to S-user .

      It should work.



      Author's profile photo Alberto Posada
      Alberto Posada

      You need to configure an Oauth Authentication for that step and call.

      Create an OAuth entry with the data of a Service Key belonging to a Service Instance Type api with the role SecurityMaterialEdit.

      Configure that OAuth entry in the http call.


      Author's profile photo Shunyashish Mohanty
      Shunyashish Mohanty

      Dear Zaheer,


      Thanks for the blog with detailed step by step explanation.

      We are facing a issue at time of Request CSID. The prior steps , CCSID request and compliance check are successful.

      But when trying to perform Request CSID the below error we are facing.


      Error response from Fatoora to CPI


      Payload:  { "compliance_request_id": "1684059671384" }





      Could you guide us on this issue.





      Author's profile photo Adeel Shaikh
      Adeel Shaikh

      Check you SOA manager setting, you need to use CPI client id and client secret in web service and then for testing you should be able to ping from there.

      Author's profile photo Fares Alshadfan
      Fares Alshadfan

      Hello Zaheer,


      Quick question, Is there a note that has the onboarding information available? I tried to submit my first eDoc and got the following error Solution Unit is not onboarded for Company code/VAT/TAX/SD_INVOICE, but there is no mention in the standard SAP notes. The informative guide you posted is not present anywhere in the parent note 3095262 or its sub-notes. Thanks!




      Author's profile photo Adeel Shaikh
      Adeel Shaikh

      As mentioned in the blog itself, you need below TCODE to onboard your system first before submitting the EDOC:


      Transaction name Transaction code
      Generate Solution Unit ID SAEGSG
      Manage Solution Unit ID SAEGSM
      Generate Cryptographic Stamp Id. SACSIDG
      Author's profile photo Warren Nash
      Warren Nash

      Has SAP considered its existing ECC6 customer based in KSA too?

      Author's profile photo Ali Imran Uppal
      Ali Imran Uppal

      Dear Zaheer DAWZI

      1. I entered the Tcode "SACSIDG"
      2. Selected the line item.
      3. Clicked on CCSID Request.
      4. Systems prompt: OTP value is required.

      Please guide in this regard that how to generate OTP Value.

      Author's profile photo Adeel Shaikh
      Adeel Shaikh

      You need to take OTP from Fatoora Platform.

      هيئة الزكاة والضريبة والجمارك (


      Author's profile photo Morad alam Dari
      Morad alam Dari

      hi @Zaheer DAWZI

      Could you please confirm if we can use CI-Process Integration (1 sub-account) to connect ZATCA with different SAP systems landscape (3 systems)?

      or we should use Integration Suite with one sub-account or 3 sub-accounts ?


      Thanks for your feedback.



      Author's profile photo Adeel Shaikh
      Adeel Shaikh

      Technically you can use one subaccount integration suite for 1 or more companies. But better check with your SAP account manager for licensing issues.

      Author's profile photo Ahmed Hasaanin
      Ahmed Hasaanin

      Could any one clarify the below error when request CCSID ?

      System failed to process your request

      Message No. EDOCUMENT_SA000


      Author's profile photo Mohamed Sherif
      Mohamed Sherif

      Hello Ahmed,

      Did you found the issue? , I'm facing the same issue

      Author's profile photo Rahul Bhat
      Rahul Bhat

      Hello Mohamed ,


      Were you able to resolve this issue ?



      Author's profile photo Rahul Bhat
      Rahul Bhat

      Hello Ahmed ,

      Were you able to resolve this ?


      Author's profile photo aamir rahman
      aamir rahman

      Hi Zaheer,

      Bravo...Excellent blog !

      As per SAP, We can create multiple logical EGS Unit with one VAT registration number with multiple company code with one leading company code.


      But in our organization, We have only company code with multiple sales division. i.e 5 Sales division with respective plants i.e 5 Plants and invoice is generating as per plant with respective defined number range.

      I need to your help, How we can map our each sales division with Logical EGS to generate e-invoice.

      As per ZATCA, Each EGS will have ICV i.e Invoice counter value...Its OK for the free text field we can maintain our invoice number in IRN  i.e Invoice reference number.


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

      Hi Aamir,


      Thank you for your motivating comments. Iam happy that you found it useful.


      Sales division in your case are set up as sales offices or sales organizations?




      Author's profile photo aamir rahman
      aamir rahman

      Hi Zaheer,

      How we can link for five Division or sales organization with each EGS logical unit.

      One leading company code with different company code is possible as per SAP, But in our organization we have one company code with different sale division.

      How we can link for five Division or sales organization with each EGS logical unit.

      Author's profile photo Rahul Bhat
      Rahul Bhat

      Hello Zaheer DAWZI ,

      Thank you for this excellent blog. The number of people who are going to benefit out of this is enormous. Keep up the excellent work.

      I have one question if you could provide me with some of your valuable inputs.

      We have tried requesting the CCSID, but we are getting the 500 error. On the SAP side , I can see the error System failed to process your request'.

      On the HCI side , error is as below : -

      Error Details
      org.apache.camel.component.ahc.AhcOperationFailedException: HTTP operation failed invoking with statusCode: 500

      We have raised this with SAP as well and they came back saying that everything is good on the SAP and HCI side of things and have asked us to contact ZATCA about this. I am clueless what is causing this error. Where can I start to try and resolve this error?


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

      Hi Rahul,

      Thank you for your appreciating comments. Iam happy that a larger audience are benefitting from this.

      The error you are facing is an internal server error at ZATCA side. This may be a temporary issue at their side. you can try after some time or directly check with ZATCA.

      You may also check this in this link


      Best Regards,


      Author's profile photo SAP SCC functional Team
      SAP SCC functional Team

      Dear Team


      This is Ganesh here,

      We are implementing the Phase 2 E invoice and i am trying to generate the XML format,

      However We face the below issue , How to get it resolved.

      Which Filed I need to update in the SAP Hana to fix this .


      Buyer ID is mandatory if Buyer VAT Registration Number is not provided
      Field ID is empty in TaxCategory of TaxSubtotal





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

      Hi Ganesh,

      Buyer ID is mandatory if Buyer VAT Registration Number is not provided

      If VAT reg number is not provided, then the other buyer ID needs to be provided. This can be maintained in the identification type SABYID in BP. Please refer to the master data for eInvoicing blog for more details.

      Field ID is empty in TaxCategory of TaxSubtotal:

      You need to maintain the tax category in the value mapping for the VAT tax codes used in your transaction.