Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

Can you associate an XML Schema with a DataWindow?

Greetings all,

We have a client that has asked for datathat has master/detail information in XML format. They are also asking for the XML to be associated with an XML Schema that they have provided to ensure that the data is validated using the Schema.

I am pretty sure I can make the XML look most like the way they want it, but not sure about how to make it exactly the way they want it.

<Invoice xsi:noNamespaceSchemaLocation="AlexFeed.xsd" xmlns:xsi=""><Vendor><VendorId>9</VendorId><TotalRides>4</TotalRides><TotalAmount>1038.54</TotalAmount><BillingCurrency>USD</BillingCurrency>

Ride><BookerEmployeeID>21416</BookerEmployeeID><BookerTieExtension>8054305</BookerTieExtension><BookerFirstName>PAUL</BookerFirstName><BookerLastName>GOYENECHE</BookerLastName><RiderFirstName>AINHOA</RiderFirstName><RiderLastName>MURRAY</RiderLastName><ReferenceId>1401745691</ReferenceId><CarId>999</CarId><RideTypeId>B</RideTypeId><AirportCode>IAD</AirportCode><RideDate>2014-08-04</RideDate><RideTime>15:35:00.0Z</RideTime><FromAddress>IAD</FromAddress><FromZone>IAD</FromZone><ToAddress>DC, WASHINGTON</ToAddress><ToZone>IAD  </ToZone><NoShow>false</NoShow><BaseAmount>108.58</BaseAmount><ServiceAmount>19.20</ServiceAmount><WaitAmount>71.78</WaitAmount><MeetAndGreetAmount>10.00</MeetAndGreetAmount><ParkingAmount>10.00</ParkingAmount><FuelSurchargeAmount>2.00</FuelSurchargeAmount><MiscAmount>36.07</MiscAmount><MiscAmountDesc>Tips,Package and Miscellaneous charge</MiscAmountDesc><NetAmount>257.63</NetAmount><TotalAmount>257.63</TotalAmount></Ride>

Thanks everyone in advance for any pointers!!



Former Member
Former Member replied

Hey Paul,

Looking at your sample this might be easier than I thought.  All you need to do is create your XML template (which you might have already done?).  The root element name should be 'Invoice' followed by 'Vendor', etc.  Your data looks like the detail row starts at 'Ride'.  After you have saved that then under the Data Export tab do the following:

1) Select your template under 'Use Template'

2) Select XMLSchema! under 'Meta Data Type'

3) Select MetaDataExternal! under 'Save Meta Data'

Now when you do a SaveAs save it as XML and give it the name AlexFeed.xml.  This will create 2 files - one with the XML and the other will be the XSD.  The XML file should look like your example above.

If this is not what you are looking for we can go further.

Chris Craft

0 View this answer in context
Not what you were looking for? View more on this topic or Ask a question