Is it possible to ignore fields when converting from XML to a flat file ? For example if my input XML is:
Is it possible to produce an output file of:
...where f3 is ignored.
Edited by: paul clements on Aug 23, 2011 3:21 PM
Edited by: paul clements on Aug 23, 2011 3:22 PM
Check out the below parameter options...
For more info on the above parameters read the sap help link below
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
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.
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.
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.
In response to Debashish...
If the current structure is:
...where would I place the field which I dont' want to be past of the FCC ?
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.
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.