cancel
Showing results for 
Search instead for 
Did you mean: 

Hierarchial data through content conversion

Former Member
0 Kudos

All,

we have an input file in the following format. (This is a fixed length file structure, where the first character is the type of the record and the rest is the data)

0XXXX

1YYYY

2MasterRow-1

3Childrow 1

3Childrow 2

4Childrow 1

4Childrow 2

2MasterRow-2

3Childrow 21

3Childrow 22

4Childrow 21

5XXXXX

we need this converted as follows, (all records are master records, only record 2 can have children. and the records of type 3 & 4 that follow record type 2 (till the next occurence of record type 2) are the children of that record.

<record><type>0</type><data>XXXX</data></record>

<record><type>1</type><data>YYYY</data></record>

<record><type>2</type><data>MasterRow-1</data>

<children>><type>3</type><data>Childrow 1</data></children>

<children>><type>3</type><data>Childrow 2</data></children>

<children>><type>4</type><data>Childrow 1</data></children>

<children>><type>4</type><data>Childrow 2</data></children>

</record>

<record><type>2</type><data>MasterRow-2</data>

<children>><type>3</type><data>Childrow 21</data></children>

<children>><type>3</type><data>Childrow 22</data></children>

<children>><type>4</type><data>Childrow 21</data></children>

</record>

<record><type>5</type><data>XXXX</data></record>

Can we do this using content conversion? or should we go for multi step mapping?

Thanks,

Accepted Solutions (1)

Accepted Solutions (1)

turmoll
Active Contributor
0 Kudos

Hi,

Ref. this doc. <a href="https://www.sdn.sap.comhttp://www.sdn.sap.comhttp://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/482aae19-0301-0010-3485-8efd618818d0">How to Handle Unstructured Source Contents for Adapters</a>

Regards,

Jakub

Answers (1)

Answers (1)

Former Member
0 Kudos

How did anyone handle the hierarchial data types that come through Flat file using content conversion?

(i think the complexity in our scenario just might be that there are some optional nodes)

Thanks