This article will demonstrate how to read data from XML based source files using SAP Data Services. Here our objective is to load employee and department information respectively from the source XML based file.

The implementation Dataflow looks like below.

Sample Dataflow to read XML source file

We have the Source XML based file. The XML format is imported from the XSD file. Next we have a Query Transform which is used for the purpose to UNNEST the Nested Data Structure, to Denormalize the data set. Next we have two Query Transforms to handle the Employee and Department information separately. Since the data is denormalized we will have to use the DISTINCT clause when loading the employee and department information to target tables respectively.

Select the top-most Schema, Right-Click and select Unnest with sub-schemas

Query Transform- UNNEST with sub-schemas

Next to get the Department information select the columns from the Schema In and Map to Output. Next go to SELECT tab and check the selection criteria of Distinct rows.

Query Transform- DISTINCT DEPARTMENT Schema

We follow the same steps to gather the Employee information from the source.

Query Transform- DISTINCT EMPLOYEE Schema

Lastly we have the corresponding Target tables to gather Employee and Department information. Finally we View Data of the Target Tables.

Target Tables- Data Preview

Have a question on this subject?

Ask questions to our expert community members and clear your doubts. Asking question or engaging in technical discussion is both easy and rewarding.

Are you on Twitter?

Start following us. This way we will always keep you updated with what's happening in Data Analytics community. We won't spam you. Promise.