on 09-28-2006 12:03 AM
basically I like to treat entire record as one field with structure as follows:
Rec1
Rec2
Rec3
I need convert this into XML as follows
<File>
<Record>Rec1</Record>
<Record>Rec2</Record>
<Record>Rec3</Record>
</File>
To do this I would like to what values I need to give for fieldseparator( 'nl' ???) and endseparator( this is end of file )
Please note I have only One field which is <Record> with 0 to unbounded
I did some testing with following values
RecordStructure = Source,1
Source.fieldSerparator = 'nl'
Source.fieldNames = Record
Its producing like this Which is not I wanted.
<File>
<Record>Rec1</Record>
</File>
<File>
<Record>Rec2</Record>
</File>
<File>
<Record>Rec3</Record>
</File>
I would like to produce
<File>
<Record>Rec1</Record>
<Record>Rec2</Record>
<Record>Rec3</Record>
</File>
Inorder to do this I should be able to distinguish between newline and endoffile conditions.
newline is 'nl'
and what is end of file ?
Also what ever parameters I gave , are they correct?
Would someone please explain. Thanks
Hi,
You can try with ignoreRecordset and check this ..Probably it works.
Otherwise, you can think with normal content conversion i.e with key values.
Have a look into this content conversion -
http://help.sap.com/saphelp_nw2004s/helpdata/en/2c/181077dd7d6b4ea6a8029b20bf7e55/content.htm
Regards,
Moorthy
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Moorthy, infact i was using ignoreRecordsetName = true since my first try.
What do u mean by normal content conversion ( with key values) ?
for my scenario whole record is treated as a field.
and Message_Tpe XSD will simiral to
<?xml version="1.0" encoding="UTF-8"?>
<ns0:Source xmlns:ns0="http://test.com">
<Source>
<Record>record1</Record>
<Record>record2</Record>
</Source>
</ns0:Source>
Do I ran out choices here ?
If you want to get as you told, I think you need to tell that, Under Source Segment, you have multiple Records .then you will get required output.
For this, you need to define key value i.e multiple occurences of Record segment with differentiating the key values.
the given link in my previous post explains the same, Just compare with your case.
Also refer this blog-
/people/sravya.talanki2/blog/2005/08/16/configuring-generic-sender-file-cc-adapter
Regards,
Moorthy
Hi Ram
I think you dont need to use fieldseparator when your record has only one field, can you try using this -->
RecordStructure = Source,1
Source.fieldNames = Record
Source.endSeparator = 'nl'
Pls. dont use
Source.fieldSerparator = 'nl'
Let me know.
- Lalit -
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Sorry to say adapter is giving error
here is error.
2006-09-27 20:40:33 EDT: Error: Conversion initialization failed: Exception: java.lang.Exception: java.lang.Exception: Error(s) in XML conversion parameters found:
Parameter 'Source.fieldFixedLengths' or 'Source.fieldSeparator' is missing
Consistency check: no. of arguments in 'Source.fieldFixedLength' does not match 'Source.fieldNames' (0 <> 1)
User | Count |
---|---|
88 | |
10 | |
10 | |
9 | |
7 | |
7 | |
6 | |
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.