on 02-19-2009 5:04 PM
Hi everybody,
In an adapter file receiver, I want to convert an XML structure to a "flat file".
here is my xml structure
<ns1:MT006_blabka>
<RECORD>
<LIGNE>TEST1</LIGNE>
<LIGNE>TEST2</LIGNE>
</RECORD>
<FILE>
<FILENAME>fichier.dat</FILENAME>
<DIRECTORY>//server1/root/</DIRECTORY>
</FILE>
</ns1:MT006_blabla>
and the text file I want to receive is
<BOF>
TEST1
TEST2
<EOF>
The problem is with the paramter of conversion I use I receive
<BOF>
TEST1
TEST2
<EOF>
I always receive an empty line at the end
The record set define in conversion are "RECORD,FILE"
in parameter i put
RECORD.fieldSeparator value : 'nl'
FILE.fieldFixedlengths value : 0,0
My problem is to eliminate the empty line at the end of the file.
Is there someone who can help me ?
Thank you in advance for your collaboration.
Regards
Eric.
Erik,
there is a webLog available.
Maybe this helps
/people/shabarish.vijayakumar/blog/2007/08/03/file-adapter-receiver--are-we-really-sure-about-the-concepts
Greets
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
You will have to modify your target structure from this
<ns1:MT006_blabka>
<RECORD>
<LIGNE>TEST1</LIGNE>
<LIGNE>TEST2</LIGNE>
</RECORD>
<FILE>
<FILENAME>fichier.dat</FILENAME>
<DIRECTORY>//server1/root/</DIRECTORY>
</FILE>
</ns1:MT006_blabla>
To this
<ns1:MT006_blabka>
<RECORD>
<Struct>
<LIGNE>TEST1</LIGNE>
<LIGNE>TEST2</LIGNE>
</Struct>
</RECORD>
<FILE>
<FILENAME>fichier.dat</FILENAME>
<DIRECTORY>//server1/root/</DIRECTORY>
</FILE>
</ns1:MT006_blabla>
use the content conversion as
recordset structure = RECORD,Struct,File,
Record.fieldSeparator = 'nl'
Struct.fieldSeparator = 'nl'
file.fieldFixedLengths = 0
file.fixedLengthTooShortHandling = Cut
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Erik,
As it seems you are not closng the record according to your wishes.
SAP Xi uses a newline as default for ending a record.
If you want that to be removed then please use endSeperator parameter '0';
See sap help
http://help.sap.com/saphelp_nw70ehp1/helpdata/en/d2/bab440c97f3716e10000000a155106/frameset.htm
and / or
http://help.sap.com/saphelp_nw04/helpdata/EN/0b/9a50465ccf84479e39a6d50c90fb3f/frameset.htm
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
That doesn't word if I put
RECORD.endSeparator '0'
FILE.endSeparator '0'
in that case I receive a file
<BOF>
TEST1
TEST2'0''0'
<EOF>
but with that idea of endSeparator, I put
RECORD.endSeparator '0x20' . ASCII space value
and no specification for the FILE recode set
and I receive the file
<BOF>
TEST1
TEST2
<EOF>
a space was added at the end of the TEST2
Thank you for you help.
Regards
Edited by: Eric KOralewski on Feb 20, 2009 10:53 AM
Hi Eric,
As you are not using the endSeparator parameter, XI adds a line break as a default end separator.
Try to use the endSeparator parameter as 0.
http://help.sap.com/saphelp_nw70ehp1/helpdata/en/d2/bab440c97f3716e10000000a155106/frameset.htm
Thanks,
Pooja Pandey
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thank you for your ssuggestion but put the parameter endSeparator 0 doesn't work.
If I put RECORD.endSeparator, I have the file
<BOF>
TEST1
TEST20
<EOF>
The 0 is added to the last line TEST2
if I put FILE.endSeparator 0, I have the file
<BOF>
TEST1
TEST2
0
<EOF>
In my conversion, I heve to specify the FILE as recordset name otherwise, that doesn't work and when I put it in the recordnames I have to define the lenghts of the field .
In my case,
FILE.fieldFixedLengths 0,0
and in that case, I receive the empty line.
Is it possible to tell by a parameter to ignore that structure FILE ?
Thank you in advance for your collaboration.
Regards
Edited by: Eric KOralewski on Feb 20, 2009 10:21 AM
Hi
Did you try
RECORD.endSeperator 0
Regards
Vishnu
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Eric,
check Queue in the Message Mapping for the target field, if you see a blank or supress after TEST2, then remove that using a MapWithDefaultValue function.
Regards,
Karna...
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
84 | |
24 | |
12 | |
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.