cancel
Showing results for 
Search instead for 
Did you mean: 

Best approach for Flat file to xml conversion

Former Member
0 Kudos

Hi ,

i have a scenario where i need to convert a flatfile delimited by hat(^) into xml for furhter mapping and processing. whats the best approach to convert it into xml format. with content conversion how would my data structure look like ?

an exmaple of the flat file is as follows

ENV001ANAA15012222222222RIPLEY PUBLISHERS5013546113221BATCH.CO.UK001128143700REF00002 ^INVFIL

INVF011INVFIL90700INVOICES5012222222222^RIPLEY PUBLISHERSFINIAL BUILDINGSDISTRIBUTION WAYFOLKLEY^HAMPSHIRE

LO98 1UY156582940^^0049980Hillside Bookshop

INVF021^073GBP

INVF0335031001127001127001127^^^7

INVO012INVOIC9^0049980Hillside Bookshop^^^^^6799909I0011270011271^0012290

INVO03111111^^^6799909I001127

INVO041197803400436080340043601^^^^1^6723517KG45434^3044100Z0000^^^699000^^699001639200^35000

INVO042197803400436080340043601^^^^1^10351KG45400^45400Z0000^^^699000^^6990024500^35000

INVO043197803406803390340680334^^^^1^10031300KG45435^4543500Z0000^^^699000^^699002446500^35000

INVO044197803406803390340680334^^^^1^10313KG45400^45400Z0000^^^699000^^6990024500^35000

INVO045197818599870491859987044^^^^1^206040KG61035^1220700A00000^^^00^^93900657300^35000

INVO045297818599870491859987044^^^^1^206040KG38940^778800Z00001^^^00^^59900419400^35000

INVO045397818599870491859987044^^^^1^206040KG22095^441900S175002^^^00^^34000237900^35000

INVO046197818599870491859987044^^^^1^10302KG61000^61000A00000^^^00^^9390032900^35000

INVO046297818599870491859987044^^^^1^10302KG38900^38900Z00001^^^00^^5990021000^35000

INVO046397818599870491859987044^^^^1^10302KG22100^22100S175002^^^00^^3400011900^35000

INVO071Z06849610^0849618496108496184961

INVO072S17500246400^04640464081254525452

INVO08289601^^00089601896018129041390413^24

INVT014INVTLR98960189601812904139041313

INVF015INVFIL90700INVOICES5012222222222^RIPLEY PUBLISHERSFINIAL BUILDINGDISTIBUTION WAYFOLKLEYHAMPSHIRELO98

1UY432582940^0106968Action Books (HO)14-16 East StreetDrumoyne^Possilpark

INVF021^073GBP

INVF0335031001127001127001127^^^7

INVO016INVOIC9^0081111Action Books - Cadder Branch^^^^^7897908I0011270011271^0012290

INVO03111112^^^7897908I001127

INVO041197803400436080340043601^^^^1^207020KG41940^838800Z0000^^^699000^^69900559200^40000

INVO042197803400436080340043601^^^^1^10351KG41900^41900Z0000^^^699000^^6990028000^40000

INVO043197803406803390340680334^^^^1^206260KG41940^838800Z0000^^^699000^^69900559200^40000

INVO044197803406803390340680334^^^^1^10313KG41900^41900Z0000^^^699000^^6990028000^40000

INVO045197818599870491859987044^^^^1^206040KG56340^1126800A00000^^^00^^93900751200^40000

INVO045297818599870491859987044^^^^1^206040KG35945^718900Z00001^^^00^^59900479300^40000

INVO045397818599870491859987044^^^^1^206040KG20395^407900S175002^^^00^^34000271900^40000

INVO046197818599870491859987044^^^^1^10302KG56300^56300A00000^^^00^^9390037600^40000

INVO046297818599870491859987044^^^^1^10302KG35900^35900Z00001^^^00^^5990024000^40000

INVO046397818599870491859987044^^^^1^10302KG20400^20400S175002^^^00^^3400013600^40000

INVO071Z06251620^0251622516202516225162

INVO072S17500242830^04283428375050335033

INVO08229445^^00029445294457503019530195^24

INVT014INVTLR92944529445750301953019513

END001^7

and the structure of the data type is as below

ENV001 (Envelope Header: one per file)

INVF01 (File Header : one per Bookshop Head office and one per Supplier)

INVF02 (File Header : repeated after every INVF01 Line)

INVF03 (File Header : repeated after every INVF02 Line)

INVO01 (Invoice Header : one per invoice)

INVO04 (Invoice detail line : one for each line unless Mixed VAT)

INVO04 (Invoice detail line : one for each line unless Mixed VAT)

INVO03 (Order reference details – refers to previous Invoice detail line, or to whole invoice if placed after invoice header)

INVO04 (Invoice detail line : one for each line unless Mixed VAT)

INVO04 (Invoice detail line : one for each line unless Mixed VAT)

INVO03 (Order reference details – refers to previous Invoice detail line, or to whole invoice if placed after invoice header)

INVO04 (Invoice detail line : one for each line unless Mixed VAT)

INVO07 (VAT Summary : one per VAT rate)

INVO08 (Invoice Total record : one per Invoice)

INVF01 (File Header : one per Bookshop Head office and one per Supplier)

INVF02 (File Header : repeated after every INVF01 Line)

INVF03 (File Header : repeated after every INVF02 Line)

INVO01 (Invoice Header : one per invoice)

INVO04 (Invoice detail line : one for each line unless Mixed VAT)

INVO04 (Invoice detail line : one for each line unless Mixed VAT)

INVO03 (Order reference details – refers to previous Invoice detail line, or to whole invoice if placed after invoice header)

INVO04 (Invoice detail line : one for each line unless Mixed VAT)

INVO04 (Invoice detail line : one for each line unless Mixed VAT)

INVO03 (Order reference details – refers to previous Invoice detail line, or to whole invoice if placed after invoice header)

INVO04 (Invoice detail line : one for each line unless Mixed VAT)

INVO07 (VAT Summary : one per VAT rate)

INVO08 (Invoice Total record : one per Invoice)

INVT01 (File Total record : one per file)

END001 (End of file record : one per file)

i guess i should use content conversion but not sure if XI can handle complex substructures. please advice me on the best approach.

thank you

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

thanks

Former Member
0 Kudos

Hi Sudheer,

You should be able to achieve this using content conversion.

Please check the following help link on how to do it using content conversion,

http://help.sap.com/saphelp_nw70/helpdata/en/0b/9a50465ccf84479e39a6d50c90fb3f/frameset.htm

The other option could be writing a small adapter module which will convert your flat file into xml using SAX parsers. You can find API for using SAX or DOM parsers on net.

Regards,

Yomesh