Vous êtes sur la page 1sur 9

How to Create an XML Schema File for an Idoc Type and Set it for Use in SAP MDM

Applies to:
SAP MDM 5.5 SP06, SAP ECC 6.0. For more information, visit the Master Data Management homepage.

Summary
This article explains how to create XML schema file for an Idoc message type in SAP ECC not provided by SAP as part of standard SAP MDM business content. This XML schema file is then setup in SAP MDM to enable syndication of data.

Author:

Neelesh Thackeray

Company: Satyam Computer Services Ltd. Created on: 15 January 2009

Author Bio
Neelesh has 20 years IT experience including 12 years in SAP (i.e; 7 years in ABAP) and has been leading the SAP MDM competency at Satyam since March 2005.

SAP COMMUNITY NETWORK 2009 SAP AG

SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com 1

How to Create an XML Schema File for an Idoc Type and Set it for Use in SAP MDM

Table of Contents
Introduction .........................................................................................................................................................3 Create XML schema file..................................................................................................................................4 Uploading the XML schema file into SAP MDM .............................................................................................5 Syndicating the MDM data using the XML schema ........................................................................................6 Summary.............................................................................................................................................................8 Related Content..................................................................................................................................................8 Disclaimer and Liability Notice............................................................................................................................9

SAP COMMUNITY NETWORK 2009 SAP AG

SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com 2

How to Create an XML Schema File for an Idoc Type and Set it for Use in SAP MDM

Introduction
Every data file in XML format must have an associated XML schema file. An XML schema defines element and attribute names for a class of XML documents. The schema also specifies the structure that those documents must adhere to and the type of content that each element can hold. A typical XML and XML schema file structure are as shown below: XML data file:
<?xml version="1.0"?> <person> <name> <firstname>Neelesh</firstname> <lastname>Thackeray</lastname> </name> <job>Consultant</job> <gender>Male</gender> </person>

XML Schema file:


<?xml version="1.0" encoding="UTF-8"?> <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"> <xs:element name="Author"> <xs:complexType> <xs:sequence> <xs:element name="FirstName" type="xs:string" /> <xs:element name="LastName" type="xs:string" /> </xs:sequence> </xs:complexType> </xs:element> </xs:schema>

Typically, SAP has provided associated XML Schema files for the standard IDOC message types such as MATMAS (Material), DEBMAS (Customer) and CREMAS (Vendor) as part of the SAP MDM business content. However, when you have to deal with other sub-master data objects such as Address, Class / Characteristics, then there are no XML schemas provided as part of the standard MDM business content. In case of Customer / Vendor master data, the address master data is sent separately. The challenge is to be able to generate an XML schema file from the XML data file. This article explains how the above can be achieved with inbuilt mechanism in the SAP ECC system.

SAP COMMUNITY NETWORK 2009 SAP AG

SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com 3

How to Create an XML Schema File for an Idoc Type and Set it for Use in SAP MDM

Create XML schema file 1. Login to SAP ECC and execute the transaction WE60 (Documentation for Idoc types) 2. Select the Idoc message type for which you want to get the XML schema file generated.

As shown in the screen above, select all the check boxes Control, Data and Status segments of the Idoc type. Besides the Data segment, it is important to select the Control segment as well even though the fields of this segment are not part of the MDM repository. The XML data file when syndicated from SAP MDM is converted into Idoc by SAP PI then it must have the control segment with its fields which will be filled by either SAP PI or by SAP MDM (using Custom Items).

SAP COMMUNITY NETWORK 2009 SAP AG

SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com 4

How to Create an XML Schema File for an Idoc Type and Set it for Use in SAP MDM

3. Select the menu option Documentation

XML Schema

The XML schema file generate for CLFMAS02 (Master Object Classification) as an example is shown below.

4. Download the XML schema file generated (menu path: XML

Download)

The XML schema file thus generated by the SAP ECC system can be stored in a local folder path to be uploaded into SAP MDM system. Uploading the XML schema file into SAP MDM 1. Connect to the MDM repository where you want to upload the previously generated XML schema file. 2. In the XML Schema table create a new record and provide the following details: a. Name of the XML schema file b. Path of the XML schema file Ensure that the MDM repository is unloaded prior to uploading the XML schema file.

SAP COMMUNITY NETWORK 2009 SAP AG

SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com 5

How to Create an XML Schema File for an Idoc Type and Set it for Use in SAP MDM

The screen shot below shows the already uploaded XML schema file (CLFMS02.XML) for the Master data Classification Idoc message type.

3. Upload the MDM repository Syndicating the MDM data using the XML schema 1. Start the MDM Syndicator and select the XML schema file as shown below:

SAP COMMUNITY NETWORK 2009 SAP AG

SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com 6

How to Create an XML Schema File for an Idoc Type and Set it for Use in SAP MDM

2. The syndication mapping can then be carried out between MDM repository fields and the XML schema fields as shown below:

Note: Essentially there are two types of XML schemas with distinct purposes as mentioned below: 1. XML schema generated from the MDM repository a. This is used to transport the MDM repository structure from Development to Production environment. 2. XML schema generated as described in this article a. This is used during the syndication of the MDM data to the relevant transactional system.

SAP COMMUNITY NETWORK 2009 SAP AG

SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com 7

How to Create an XML Schema File for an Idoc Type and Set it for Use in SAP MDM

Summary
In the scenario that you need the XML schema of a particular version of the Idoc message type (for example; MATMAS01, etc) for syndicating the master data from SAP MDM to SAP ERP, the technique described above will be useful.

Related Content
http://help.sap.com/saphelp_mdm550/helpdata/en/8e/9f9c427055c66ae10000000a155106/frameset.htm http://help.sap.com/erp2005_ehp_04/helpdata/EN/dc/6b824843d711d1893e0000e8323c4f/frameset.htm https://www.sdn.sap.com/irj/sdn/nw-mdm

SAP COMMUNITY NETWORK 2009 SAP AG

SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com 8

How to Create an XML Schema File for an Idoc Type and Set it for Use in SAP MDM

Disclaimer and Liability Notice


This document may discuss sample coding or other information that does not include SAP official interfaces and therefore is not supported by SAP. Changes made based on this information are not supported and can be overwritten during an upgrade. SAP will not be held liable for any damages caused by using or misusing the information, code or methods suggested in this document, and anyone using these methods does so at his/her own risk. SAP offers no guarantees and assumes no responsibility or liability of any type with respect to the content of this technical article or code sample, including any liability resulting from incompatibility between the content within this document and the materials and services offered by SAP. You agree that you will not hold, or seek to hold, SAP responsible or liable with respect to the content of this document.

SAP COMMUNITY NETWORK 2009 SAP AG

SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com 9

Vous aimerez peut-être aussi