cancel
Showing results for 
Search instead for 
Did you mean: 

Content Conversion - Ignore Fields

Former Member
0 Kudos

Hi,

Is it possible to ignore fields when converting from XML to a flat file ? For example if my input XML is:

<RecordSet>

<Record>

<f1>a</f1>

<f2>b</f1>

<f3>c</f1>

</Record>

<Record>

<f1>d</f1>

<f2>e</f1>

<f3>f</f1>

</Record>

</RecordSet>

Is it possible to produce an output file of:

a,b

d,e

...where f3 is ignored.

Cheers,

PaulC.

Edited by: paul clements on Aug 23, 2011 3:21 PM

Edited by: paul clements on Aug 23, 2011 3:22 PM

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

hi,

in the FCC use two more entries in Content conversion but before that add it in the recordset structure lets say as XXXXX

then in the entries use it as

XXXXX.fieldFixedLengths / 0

XXXXX.fixedLengthTooShortHandling / Cut

This XXXXX can be the filed name that is coming in XML and the two entries keep this out of the flat file.

This is a demo you may have to work a little in defining the filed names. This will work as I have used it in my case.

Regards.....

Former Member
0 Kudos

Hi,

Thanks. This is a very good solution.

One question remaining. I am now able to supress the relevant data from showing in the output file. However, as the default endSeparator is 'nl' I get a blank line appearing in the file.

Therefore the last question I have is...is it possible to have an endSeparator of NULL i.e. just start the next part of the output structure on the same line as the supressed data. Have tried '' and "" and neither work.

Cheers,

PaulC.

Former Member
0 Kudos

Hi Paul,

You can solve that by not specifying the "XXX.endSeparator" entry for this record as "endSeparator" is an optional entry.

So, if you don't specify this, the next record would start in the same line/place.

Hope this helps.

Regards, Gaurav.

Former Member
0 Kudos

Kumar,

According to help.sap.com the default value is a line break i.e. if you don't explicitly mention the endSeparator you get a new line between structures. Therefore I think I need to use it but in such a way as the separator is effectively NULL.

PaulC.

Former Member
0 Kudos

Found it !!

You can use endSeparator values of '0xHH' where HH is the Ascii Hex code. The Ascii Hex code for NULL is 00 therefore an endSeparator value of '0x00' will give me what I want i.e. the next structure starting on the same line as the previous one.

Cheers,

PaulC.

Answers (6)

Answers (6)

Former Member
0 Kudos

Marked as "Unanswered" as I need more information if possible.

Edited by: paul clements on Aug 23, 2011 5:23 PM

Former Member
0 Kudos

In response to Debashish...

If the current structure is:

<MT_Message1>

<PaymentRecords>

<PaymentRecord>

<f1>a</f1>

<f2>b</f2>

</PaymentRecord>

<PaymentRecord>

<f1>c</f1>

<f2>d</f2>

</PaymentRecord>

</PaymentRecords>

</MT_Message1>

...where would I place the field which I dont' want to be past of the FCC ?

Former Member
0 Kudos

Thanks for the answers. The only reason I was including a particular piece of data within the XML message was to allow me to use it as a Substitution Variable within the File Name Scheme. The data itself is not needed on the final file. Looks like I can't really do this as anything which presents to the Content Conversion within the Receiver Adapter must end up on the output file.

former_member854360
Active Contributor
0 Kudos

hi,

then move the extra field in a separate node/substructure and dont mention that node in recordset structure in FCC parameter.

Mention those substructure which you want to see in target file. Other substructuure will be ignored.

Under Recordset Structure, enter the substructures using the pattern NameA,NameB,....

If you want to convert all substructures using the same parameters, you only have to specify one structure. The entries are automatically applied to all substructures.

If you specify more than one structure, the list must contain all the structures occurring in the document. The list must be complete, otherwise a processing error will be triggered at runtime.

Former Member
0 Kudos

Debashish...that sounds like a plan. I'll see if that works !!

Former Member
0 Kudos

Hi Paul,

You have two options:

If you dont want those elements then why creating them at all. Remove them from Target datatype itself, so that you dont have these elements.

Else suppress these values in mapping and use mapwithdefault with spaces equal to the lenght of the fields so that you dont run into any issues for field content conversion.

Regards,

---Satish

former_member854360
Active Contributor
0 Kudos

If you can suppress the unwanted field in mapping itself then it will be better.

If its a fixed length file then you can try to mention

NameA.fieldFixedLengths 1,1,0

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

Former Member
0 Kudos

Hi,

Check out the below parameter options...

NameA.missingLastFields

NameA.additionalLastFields

For more info on the above parameters read the sap help link below

http://help.sap.com/saphelp_nw73/helpdata/en/44/658abd344a4de0e10000000a1553f7/frameset.htm

HTH

Rajesh

Former Member
0 Kudos

Isn't that a SENDER adapter parameter ?

What I am trying to do is output a file from XML already in PI.