Skip to Content
Technical Articles
Author's profile photo Marcos Fregonese

eInvoice with SAP DRC Electronic document processing using extensibility features

The end-to-end solution described below fits any new development for Electronic document processing.

Why use SAP DRC for eInvoice?

The eInvoicing processing is very sensible and demands a high level of monitoring and error handling and SAP DRC with its eDocument framework and SAP Application Framework Interface (AIF) can together deliver a great solution to handle this challenge. 


Technical components

eDocument Framework – Create eDocuments based on source documents (SD Invoice, FI Invoice, Accounting posting)

Application Interface Framework – Implement and Monitor interfaces. Field Mappings. Value Mappings. Error handling.

Web Service Runtime – Allow to consume API Web Service (Soamanager) 

SAP Cloud Connect – Handle authentication and message sending to Tax authority.


This figure gives an example of an architectural overview:


The following figure depicts an example of electronic document processing.


  1. You create the source document (for example, an invoice) using an SAP application. Once you post the source document, the system creates an instance of the electronic document (eDocument) in the database.
  2. You submit the eDocument by running the eInvoice process in the eDocument Cockpit ( EDOC_COCKPIT transaction).
    For more information, see the application help documentation directly in the report.
    The system retrieves the eDocument from the database and calls the interface connector to deploy the eDocument Interface connector (EDOC_INTERFACE_CONNECTOR) Business Add-In (BAdI).
    Note: This BAdI calls the interface type that enables the system to connect to the Application Interface Framework.
  3. The Application Interface Framework triggers the mapping of transactional data into the required XML format and saves the XML files.
    The system calls the integration service via an ABAP Proxy and establishes communication with the tax authorities or business partners’ systems.
    If the call is successful, the XML is saved. After successfully receiving the response, the response XML is saved.
  4. The integration service processes the XML to comply with the official communication requirements and triggers the corresponding Web Services for sending the XML file over to the external system.
  5. The integration service receives information regarding the status of the request back from the external systems, transforms it into a consumable format (by decoding and mapping the result), and forwards it to the Application Framework Interface and this to the system.
  6. The system updates the eDocument in the database with information from external systems.


Developing the Process


Important: This guide assumes that you are familiar with ABAP development, SAP Application Interface Framework, and integration flows from SAP Cloud Integration.


Creating an eDocument Process


  1. Create class ZCL_EDOCUMENT_MY as a subclass of CL_EDOCUMENT
  2. Create a new record on view EDOCOUNTRYTCH for Country “MY”, Class “ZCL_EDOCUMENT_MY”, and Proc.Mgr active
  3. Create a database table to store eDocument instance information, using EDOC_GUID as a key field.
  4. Create a new eDocument type at view EDOTYPEV and specify the table name created before.
  5. Create a DB handler interface. Should have a method for each of the possible operations such as INSERT, DELETE, MODIFY, SELECT, etc.
  6. Create a DB handler class as a subclass of CL_DOCUMENT_DB and implement the interface created before.
  7. Implement the class as a subclass of ZCL_EDOCUMENT_MY. Create an attribute for DB connection using the ABAP interface you defined before. Define the methods to handle the actions that were defined during the process definition. Ex: Create, Send, Validate, and so on.
  8. Create the SAP Application Interface Framework interface mapping structures. You can directly reuse or create a copy of existing structures.
  9. Implement a class as a sub-class CL_EDO_MAPI_AIF. 
  10. Implement Process Manager using view cluster EDOC_PROCMGR.


Creating a Web Service Proxy


  1. Create an Integration Flow in SAP Cloud Integration using WSDL provided by tax authority.
  2. Create the Consumer Proxy
  3. Configure the Consumer Proxy logical port using SOAMANAGER


Creating an SAP Application Interface Framework (AIF) Interface 


  1. At this moment, the Consumer Proxy class created before is used.

Please refer AIF documentation to create the interface


Linking the components


  1. Link the eDocument Process to SAP Application Interface Framework in the view EDOINTAIFV
  2. Link the eDocument Interface to the Web Service Proxy using views EDOSOASERV and EDOINTV
  3. Link the Business Process to Document Compliance by transaction FIBF
  4. Link the Back-End Process
    • Assign eDocument Type to Accounting Document Type (T003EDOC)
    • In the Develop the Interface Connector ABAP Class Business Add-In, copy from the sample implementation of the interface connector class.
    • create a new implementation for BADI EDOC_INTERFACE_CONNECTOR
    • Specify the implementation and create the BAdI implementation ABAP class using the one copied above.
    • Create the runtime filter value for the BAdI
    • In eDocument: Source Type (EDOSRCTYPEV), make sure the structure and ABAP class used to relate the source information with the Document Compliance Framework are in place



Reference: Extensibility for Electronic Document Processing | SAP Help Portal

Assigned Tags

      You must be Logged on to comment or reply to a post.
      Author's profile photo Bart Delaere
      Bart Delaere

      Hi Marcos,
      Nice overview!

      "SAP Standard does not provide an eInvoice solution for Malaysia as same as Italy"
      Is this an official statement from SAP?
      Don't see an update on Legal Change Notification or DRC Community.

      Author's profile photo Marcos Fregonese
      Marcos Fregonese
      Blog Post Author

      Hi Bart,

      At this moment I do not see any thing regarding eInvoice solution for Malaysia from Sap documentation.

      See below:

      If You are still in doubt, You can issue a ticket to SAP Support and ask. 

      If You do this, please let us know the official position from SAP.






      Author's profile photo Bart Delaere
      Bart Delaere

      Hi Marcos,

      1/ On the DRC Virtual Summit of last September - I saw Malaysia on "New Legal Mandates" in the column 'Under consideration (law to be confirmed or under analysis).

      2/ On LCN on Expected Solution, we see:
      "We are currently analyzing the information available, including the e-Invoice Guideline and Catalogue released by the LHDN on September 29, 2023. In the meantime, we are waiting for the LHDN to release the following tools ..."


      That's why I'm curious about the origin of your statement "SAP does not provide an eInvoice solution for Malaysia".

      Author's profile photo Erika Buson
      Erika Buson

      Hi Both - this is to confirm SAP has published the roadmap for e-invoices in Malaysia. I confirm SAP plans to provide a standard solution enabling the integration with SAP Document and Reporting Compliance, cloud edition. Subject to release of test environment from authorities, it's now planned for mid April 2024.


      Any customer involved in the pilot with tax authorities can reach out to us.

      Thank you. Erika

      Author's profile photo Kristianto Lasmindar
      Kristianto Lasmindar

      Hi Bart,

      You can find the latest update on official statement from SAP below, written by Mervyn, our SAP LPM (Localization Product Management) colleague for Malaysia :

      Thank you.

      Author's profile photo Erika Buson
      Erika Buson

      Hi Marcos -

      Thank you for the informative blog, however it indeed doesn’t represent the latest status as SAP is currently evaluating the solution for Malaysia and expects to update roadmap/legal change announcement shortly.

      The links added to the previous comments represent the scope already released to customers, they don’t include roadmap items. Of course, the solution for e-invoices in Malaysia is not released yet as there are no API / test system from tax authorities yet and tech specifications are still WIP. This means there can’t be any working solution at this stage.

      For upcoming legal changes, the recommendation is to use our Announcement of Legal Changes where you can find the latest status of upcoming regulations, including Malaysia:

      -          SAP S/4HANA Cloud, private edition / SAP S/4HANA / SAP ERP:

      -          SAP S/4HANA Cloud, public edition:

      If SAP would have decided to not support, they would be marked ‘out of scope’. As you can see, it's not the case. Stay tuned as they will be updated shortly.


      UPDATE Nov 1, 2023: SAP has confirmed roadmap for e-invoices in MY. Scope and timeline detailed in the links above.

      Thank you. Erika

      Author's profile photo AMIT GUPTA

      Hello Erika,

      I have heard that SAP has now shifted focus on providing integration to tax authorities via SAP Document and Reporting compliance Cloud Edition rather than SAP Integration suite to reduce ongoing effort for patches and to keep the connection up running.

      Will SAP consider SAP Integration suite, or will they use SAP Document and Reporting compliance Cloud Edition hosted on BTP for Malaysia E-Invoicing solution?



      Author's profile photo Erika Buson
      Erika Buson

      Hi Amit - yes, in-line with our strategy and with the aim to minimise the effort for customers, it will be with SAP Document and Reporting Compliance, cloud edition. Also, please note there will be also optional exchange to business partner via Peppol network.

      Thank you. Erika

      Author's profile photo Martin Lin
      Martin Lin

      If you check the legal notification tool ( you will see that SAP will indeed cover Malaysia E-Invoicing.