cancel
Showing results for 
Search instead for 
Did you mean: 

Generating XML output with Nested Structure, creates Multiple records!

former_member498903
Participant
0 Kudos

Hello Experts,

I have source as XML, it has NRDM structure, I consume the XML and performed the transformations and now it is ready for output, while creating an output it again shall have same NRDM structure as source and XML as output format.

Now, before outputing to XML file, I have created nested structure same as source in query transform and for output I am making use of 'Nested schemas template' from Tool palate which as it is takes the structure maintains in query transform.

Validating job does not give any problem and with single record from source template table job runs successful and provides 1 record as output but as soon as I increase the count 2, 5, 10 records for processing, it starts multiplying the records in output. Let say for 2 records it creates 4 records in output, for 10 records it creates 100+ records. and for 14kb source file it creates some 20+mb records file, which is not expected.

what is been expected:

1. if the source XML contains 1 record then output XML shall have 1 record, if Source XML contains 20 records the output XML shall have 20 records with same same NRDM structure as source and so on.

Tried and tested below options:

1. I tried placing Primary key constraint wherever possible but still the same output.

2. tried using the same source XSD schema for Traget schema and then to generate the xml output but still the same output.

Limitation:

1. As it is a NRDM structure, cannot put distinct clause anywhere

2. Unable to put group by clause.

I missing something to implement, could you please provide me your suggestion.

Attached screenshot for your reference.

Thanks in Advance for your valuable suggestions.

Accepted Solutions (0)

Answers (2)

Answers (2)

former_member498903
Participant
0 Kudos

Thank Dirk for your Input; I achieved the desired output using join conditions for every nested XML schema.

While doing R&D on how to build the structure I went through the above link and it help getting me an idea. I also tried using Row_generation and XML_MAP transform but the join conditions worked appropriate in my case.

I will probably put a blog on this as this scenario was no where present and shall be helpful for others.

I am closing this thread for now!

Cheers!

former_member187605
Active Contributor
0 Kudos

Please go thru our wiki pages on NRDM first:

https://wiki.scn.sap.com/wiki/display/EIM/The+Nested+Relational+Data+Model+NRDM. You may need the Row_Generation transform. Or you are missing the where clause for linking master and detail segments.

Alternatively, consider using the XML_Map transform to build hierarchical structures.