Projects:SAP ECC Integration/TechnicalDocumentation
The technical documentation of the External Integration Infrastructure project is available here.
High Level Class Overview by Package
For this project only the EDL classes related with import had to be customized. Those related with export are reused from the External Integration Infrastructure project.
These are the classes customized in the SAP ECC Integration module:
- SapEccAsynchProcessor: Reads the raw data of the data processor, which is a series of idocs concatenated, and splits them into batches and items.
- ImportDataProcessor: Given the contents of an iDoc, gets rid of the irrelevant parts and store the relevant content in the EDL Request line.
- ImportItemProcessor: Processes the EDL Requests. It creates an SynchronizableBusinessObject using an XmlToSynchronizableBusinessObjectConverter, and imports it using an SynchronizableBusinessObjectImporter.
The classes in this package and its debug, ftp and jco packages are in charge of the communication with the SAP ECC server.
- IdocSynchronizer is the abstraction in charge of communicating with the SAP Ecc Server. It is referenced by SapEccExporterSynchronizableBusinessObjectExporter and ImportSynchronizationProcess to export/import data to/from SAP respectively. It has three implementations:
- LocalFieldIdocSynchronizer: To be used in debug mode, instead of sharing data with a real SAP ECC server, data is read from / written to a local folder.
- FtpIdocSynchronizer: Shares idocs with SAP through a shared folder, using the IdocFTPClient class.
- JCoIdocSynchronizer: Exports data to the SAP ECC using the Java Connector (JCo) middleware. This is the only IdocSynchronizer that is only used to export data, because in order to import the data via JCo, the SAP Server is the one who starts the communication, and the imported idocs are received by the JCoIdocImporter class.
The following classes manage the reception of incoming data from SAP through JCo:
- JCoListenerInitializer is an ApplicationInitializer invoked on Tomcat startup, and does the following:
- Registers the JCoDesetinationDataProvider and JcoServerDataProvider, DataProviders that read the information about the JCo client and server from the application dictionary.
- Creates and configures an instance of JCoIdocServer. The most important class needed by JCoIdocServer is the JCoIdocImporterFactory. This class will create an instance of JCoIdocImporter each time an iDoc is received from the SAP Server via JCo. That class will create EDL requests to import the received iDocs using the EdlRequestCreator class.
This package contains utility classes related with iDocs that do not fit in other packages:
- IdocUnwrapper: Receives the content of an iDoc as input, and removes the segments that are not needed. The result is stored as the content of the EDL request lines.
- IdocXmlFormatter: Gives a nice format to the iDocs that are exported
- XmlToSynchronizableBusinessObjectConverter: Given the content of an iDoc, it creates a SynchronizableBusinessObject that will contain all the properties that the imported iDoc contains.
The SAP ECC Integration module uses the Freemarker template engine to create iDocs:
- IdocGenerator: The class invoked by SapEccExporterSynchronizableBusinessObjectExporter to generate an iDoc, given an iDoc type and a map of properties. Given the iDoc type, it looks for an IdocTemplate defined with the proper IdocType annotation.
- IdocTemplate a subclass of BaseTemplateComponent, that must be extended by all the template components meant to populate iDoc templates.
- IdocFreemarkerTemplateProcessor: The Template Processor to be used in the iDoc templates. It uses the IdocHookGenerator to automatically inject hooks in the iDocs, enabling their extension. The hooks it injects aren methods that will be processed by the IdocTemplateExtender.
- SapEccExporterSynchronizableBusinessObjectExporter: Extends BaseSynchronizableBusinessObjectExporter. Implements the export method by iterating on the SynchronizableBusinessObject to be exported, generating iDocs based of them using an IdocGenerator and exports them to the SAP ECC Server using an IdocSynchronizer
- ImportSynchronizationProcess: Subclass of ImportExternalSynchronizationProcess. Implements the getRequestsInformation by retrieving the information of the iDocs to be imported using an IdocSynchronizer
- ExportExternalSynchronizationProcess, it just overwrites the System Type.