on 08-23-2011 2:20 PM
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
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.....
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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.
Marked as "Unanswered" as I need more information if possible.
Edited by: paul clements on Aug 23, 2011 5:23 PM
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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 ?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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.
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
80 | |
24 | |
11 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.