cancel
Showing results for 
Search instead for 
Did you mean: 

FCC XML - Flat File (Single line)

markbernabe
Active Participant
0 Kudos

Hi Experts,

My input XML file has this structure:

<root>

     <record>

          <nameA>

                    <type>1</type>

                    <name>abc</name>

                    <age>10</age>

          </nameA>

          <nameB>

                    <type>2</type>

                    <street>qwe<street>

                    <code>1234</code>

          </nameB>

          <nameB>

                    <type>2</type>

                    <street>rty<street>

                    <code>5678</code>

          <nameB>

          <nameC>

                    <type>3</type>

          <nameC>

          <nameD>

                    <type>4</type>

                    <field>zxcv></field>

          </nameD>

     </record>

</root>

with the following occurrence:

record: 1

nameA: 1

nameB: 1-unbounded

nameC: 1

nameD: 1

After FCC, the output flat file should be this - just a single line

1 abc 10 2 qwe 1234 2 rty 5678 3 4 zxcv

Is this possible thru FCC? Which specific parameter can I use to achieve this?

Appreciate your inputs.

Thanks!

Accepted Solutions (1)

Accepted Solutions (1)

former_member184681
Active Contributor
0 Kudos

Hi Mark,

Try with the following settings:

Recordset Structure = Row

Row.fieldSeparator = '0x20'

Row.endSeparator = '0x20'

'0x20' is a Unicode-encoded "space" character. This should do the job for you.

Regards,

Greg

markbernabe
Active Participant
0 Kudos

Hi Greg,

Thanks. I tried it but only the <type> fields got converted. Did I miss anything?

Result:

1 2 2 8 9

Thanks!

former_member184681
Active Contributor
0 Kudos

I think it might be because your structure is nested one level more than the expected structure mentioned in help:

http://help.sap.com/saphelp_nw04/helpdata/en/d2/bab440c97f3716e10000000a155106/content.htm

Try changing your structure to:

<root>

   <nameA> ... </nameA>

   <nameB> ... </nameB>

...

</root>

so simply remove the <record> node in between.

Regards,

Greg

markbernabe
Active Participant
0 Kudos

Hi Greg,

I'm afraid I wouldn't be able to change the structure as it's been a fixed format provided to me. If this is not possible, then I would just convince the other party to accept a flat file with multiple lines. Thanks again for sharing your insights!

Former Member
0 Kudos

Hi Mark,

you could remove that structure in a mapping.

Regards,

Jörg

former_member184681
Active Contributor
0 Kudos

Mark,

Jörg is right, you can always use a different structure on the receiver side, than you've been delivered for the sender side. It's a little more work for you in PI, but lets you complete the requirement 100% as expected.

Regards,

Greg

markbernabe
Active Participant
0 Kudos

Hi Jörg,

Thanks for reminder! I will try this out.

Answers (0)