Although I heard a lot about Reference document in SAP xMII from the very first day I couldn’t find a good documentation or tutorial on how to use it and what for. Reference Documents in SAP xMII is an area less discussed and unknown to many developers, but if used wisely it can be a very powerful tool for the SAP xMII composite application developers.
As SAP xMII is positioned as the integration platform for all manufacturing and shop-floor connectivity operations with enterprise systems, many a times we may need to create a standard mapping (e.g. B2MML, OAG, etc) in SAP xMII using the BLS Transactions. The standards are usually defined by xsd in form of xml schema. While doing the standard mapping in SAP xMII we need to map data coming from different disparate systems with the standard structure. Here the SAP xMII Reference document can play a significant role.
There are two Reference Document action blocks available in SAP xMII BLS Transaction – Reference Document Loader and Reference Schema Loader. You can use these actions blocks to load any XML document or XML schema (xsd file) present in the ReferenceDocument folder in xMII installation, and can use its structure to create a mapping logic.
For example let us consider a case where we want to map the ISA95 B2MML messages with SAP RFC/BAPI using SAP xMII BLS Transaction. All the ISA95 B2MML messages schema are provided in SAP xMII 11.5 release under the ReferenceDocument/B2MML-V02 folder and can be accessed by the Reference Schema Loader action. Add a Reference Schema Loader action and configure the action as shown below:
Here we have selected the ProductionSchedule B2MML message in the Reference Schema Loader action. Select the node (here the top-most node ProductionSchedule) as the Reference Schema source in the Element Name drop-down. The Reference Document XML structure will now be same as the assigned document’s structure (xsd).
We have a Transaction output parameter of type Xml with which we want to map the B2MML structure. To do this we can use the “Assign Reference Documents” function available in the Transaction Editor’s “Reference” Menu . Click on the menu “Assign Reference Documents” and in the dialog box select the transaction output parameter OutputXML and click on the “…” button below. Select the top-most node of the Reference Schema action (ProductionSchedule) from the left-side and click OK. Now click on “Assign Reference Document” button and then OK.
By using the Reference Document it has become very easy to map the B2MML message to the Transaction parameter. In this way developers can leverage the Reference Document feature of SAP xMII while creating mapping logic based on a standard structure.