cancel
Showing results for 
Search instead for 
Did you mean: 

File Content Conversion From Nested XML to Flat File

Former Member
0 Kudos

I have as the output of my mapping:

<MT_INVOICE>   (1...1)

     <Header>    (0....unbounded)

          <HeaderField 1>

          <HeaderField 2>

          <HeaderField 3>

          <Item>   (0... unbounded)

               <ItemField 1>

               <ItemField 2>

               <ItemField 3>

My output needs to look like:

HeaderField 1, HeaderField 2, HeaderField 3

ItemField 1, ItemField 2, ItemField 3

ItemField 1, ItemField 2, ItemField 3

ItemField 1, ItemField 2, ItemField 3

ItemField 1, ItemField 2, ItemField 3

.

.

.

HeaderField 1, HeaderField 2, HeaderField 3

ItemField 1, ItemField 2, ItemField 3

ItemField 1, ItemField 2, ItemField 3

ItemField 1, ItemField 2, ItemField 3

ItemField 1, ItemField 2, ItemField 3

.

.

.

HeaderField 1, HeaderField 2, HeaderField 3

ItemField 1, ItemField 2, ItemField 3

ItemField 1, ItemField 2, ItemField 3

.

.

.

I understand basic File Content conversion but I am unable to generate any output. I keep getting a standard error message in RWB tellng me my content converion is wrong.

Is it possible to do this with standard FCC, and if not, what would be the correct path to do this?

Current FCC setup:

Recordset Structure   Header, Items

Header.fieldSeparator           ,

Header.endSeparator            , 'nl'

Header.fieldFixedLengths      3,8,3,9,9,10,13,14,13,42

Header.fixedLengthTooShortHandling    Cut

Header.fieldNames                 Bunch of names

Item.fieldSeparator                 ,

Item.endSeparator                  , 'nl'

Item.fixedLengthTooShortHandling     Cut

Item.fieldFixedLengths           3,8,3,9,9,10,13,14,13,42

Item.fieldNames                    Bunch of names different than above

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi,

You need to modify your output structure as follows:

MT_INVOICE

     RECORDSET

          HEADER

               HEADERFIELD1

               HEADERFIELD2

               HEADERFIELD3

          ITEM

               ITEMFIELD1

               ITEMFIELD2

               ITEMFIELD3

Here RECORDSET is 0..n and be created for number of headers. Under 1 recordset there should be only 1 header and associated item records for it.

Now in FCC you need to give following

Recordset Structure          RECORDSET,HEADER,ITEM

RECORDSET.fieldSeparator     'nl'

<Rest of the rules for header and item as you specified above>

This should help you get the required output file format.

Let me know in case of any issues.

Regards,

Anurag

Answers (4)

Answers (4)

Bhargavakrishna
Active Contributor
0 Kudos

Hi Dave,

You can do the content conversion for sub-nodes as well by specifying them in the record structure.

Refer below links for the same

http://www.saptechnical.com/Tutorials/XI/Contentconversion/page2.htm

http://wiki.sdn.sap.com/wiki/display/XI/Basic+File+Adapter+Content+Conversion

Refer This blog as well

http://scn.sap.com/thread/956578

It should work.

Hope it will helpful..

Regards

Bhargava krishna

former_member609026
Participant
0 Kudos

Hi Dave,

copy the exact error for your runtime work bench.

Regards,

pradeep A.

Former Member
0 Kudos

According to SAP help subnodes are not supported

The expected XML structure contains the structure as nodes filled with any number of elements without additional subnodes.

Also refer to

Regards, Martin

Muniyappan
Active Contributor
0 Kudos

Hi,

Can you check this below link and do some work around to get your required output?

http://wiki.sdn.sap.com/wiki/display/XI/FCC+For+Hierarchical+Structure+in+Receiver+Channel

if you don't get it please let us know.

Regards,

Muniyappan.