Technology Blogs by Members
Explore a vibrant mix of technical expertise, industry insights, and tech buzz in member blogs covering SAP products, technology, and events. Get in the mix!
cancel
Showing results for 
Search instead for 
Did you mean: 
mfregon
Participant
0 Kudos
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:



Context


The following figure depicts an example of electronic document processing.



Procedure



  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.

  11. Configure eDocument Interfaces using views EDOINTERFACEV, EDOINTVERSIONV, EDOPROCSPINTDETV, EDOPROCSTEPDETV and EDOINTTYPEV

  12. Configure the eDocument cockpit using views EDOMETASTATDETV, EDOMAPCLASSDETV, EDOMETASTATUSV, EDOPROCFUNCASGV, EDOPROCFUNCARCV,  


 

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

    • Activate FI_INVOICE in view EDOCOMPANYACTIV

    • 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
9 Comments
Labels in this area