Content conversion sender keyfield + unknow length field
hi,
I have a file with lines. the first six chars of each line tells me which type of line it is.
I need to split the file to files which contains only one type of lines each.
I bulit data type with 2 fields : ID - length = 6 chars, Data - length unknown.
I can use ID as keyfield but i don't have length or separator.
How do i achive the split with the sender channel content conversion?
Is there another way I can define my data type to solve this?
Thanks
Tomer
Hi
You can use the FCC parameter
fieldFixedLengths and fieldNames.
Define fieldName as ID and length will be 6. The remaining can be taken into different field.
This you can map to two different structures in message mapping. If you are confirtable with Java or XSLT that can work too.
Thanks
Gaurav
Similar Messages
-
Content conversion parameters for fixed length file
Hi,
Hey i have a small doubt.My input is like this
99443 123213 232234 12312 127544 23423
Here i have four recorsetnames namely HEADER1,HEADER2,HEADER3,HEADER4,HEADER5,HEADER6 all the recordsets are of same size but the lengths of the fields in it vary so i specified the following parameters
HEADER1.fieldFixedLengths=1,3,1
HEADER1.fieldNames=value1,value2,value3
HEADER1.endseperator=" "
HEADER2.fieldFixedLengths=1,3,2
HEADER2.fieldNames=value1,value2,value3
HEADER2.endseperator=" "
MY OUPUT XML STRUCTURE SHOULD BE like this
<header1>
<value1>9<\value1>
<value2>944<\value2>
<value3>3<\value3>
<\header1>
<header2>
<value1>1<\value1>
<value2>232<\value2>
<value3>13<\value3>
<\header2>
Is the content conversion parameters i specified enough for that. I wanted to know how would it know the begin of the next recordset(ie the seperation between the two recordsets) .Please help me its vey urgent
Thanks in advance
SriandhAre header 1 fields always going to occur first , then header 2 and so on?
By default file adapters do not support Nested Strcutures and so if the sequence is going to be the same and all of these have an occurence of 1..1 then things will work.
But if there is going to be an occurnece of * then you will need to use KeyFields.
Regards
Bhavesh -
File content conversion - sender adapter for Header and detail records
Hi Experts,
I am receiving a field of fixed length content format.(Header)The first line of the file will follow the structure X having some fields and (DetailRecord)subsequent lines in the file will follow structure Y having somes fields.There is no record identifier for Header and Detail records.In one file first line is Header records and remaining subsequent line is DetailRecord.What are the parameters we have to set for sender file content conversion parameters as i donot have any key field and key field value.And in one file we have only one header records ( first line) and n number of detail records from 2nd line onwards.
Thanks
DeepakHi
Refer the below fourm link,
Flat file whitout id
Regards
Ramg. -
File Content Conversion Sender. Enclosured info
Hi experts,
I have to read a plain file like this:
x
x
x
x
x
<START-OF-FILE>
a;b;c;d;
a;b;c;d;
a;b;c;d;
<END-OF-FILE>
x
x
x
x
x
Where 'x' means unuseful and unformatted lines, and 'a','b','c','d' are the fields to be parsed to xml.
I wonder whether there is a way, using FCC in the file sender adapter, to gather only the lines enclosured between '<START-OF-FILE>' and '<END-OF-FILE>'. There is no key field I can use.
Many thanks in advance,
PacoHi Francisco,
I think u need to write a UDF to achieve the requirement.
And, I think there is a possibility to do it using content conversion.
Use set NameA.fieldFixedLengths for the unused data in the file.
use NameA.fieldContentFormatting - Enter trim to remove all the leading and subsequent blanks for a value found. This is the default.
If there is any field length restriction use NameA.fieldFixedLengths.
NameA.fieldSeparator & NameA.endSeparator shoulf be used.
NameA.additionalLastFields
If the inbound structure has more fields than specified in the configuration then the XML outbound structure is created as follows:
○ ignore
Outbound structure only contains the fields in the inbound structure
○ error
Conversion is terminated due to the incomplete inbound structure. An error message is displayed.
The default value is ignore. If you have defined the NameA.fieldFixedLengths parameter, the default value is error.
I hope this info will help you.
Refer the below link:
http://help.sap.com/saphelp_nw70ehp1/helpdata/en/2c/181077dd7d6b4ea6a8029b20bf7e55/content.htm
Regards, -
File content conversion sender adapter
Hi Friends,
I am doing File to IDoc scenario.
I am using File Content Conversion for File Adapter.
My structure look like this
MT_File
HEADER1 1..1
--header1
-- header2
HEADER2 1..1
--header3
DETAILS 1..unbounded
--details1
--details2
--details3
TRAILER1 1..1
-- trailer1
TRAILER2 1..1
-- trailer2
----trailer3
In File Content conversion parameeters..
Document Name :MT_File
Document Namespace :urn:test:FileFcctoIdoc
RecordSet name :
RecordsetStructure :HEADER1,1,HEADER2,1,DETAILS,*,TRAILER1,1,TRAILER2,1
RecordSet Structure: Ascending
RecordSet Per message : *
Key Field Name :header1,header3,details1,trailer1,trailer3
ignoreRecordsetName : true
HEADER1.fieldNames :header1,header2
HEADER1.keyFieldValue : H1
HEADER1.fieldFixedLengths :5,10
HEADER1.endSeparator :'nl'
HEADER2.fieldNames :header3
HEADER2.keyFieldValue : *D
HEADER2.fieldFixedLengths :5
HEADER2.endSeparator :'nl'
DETAILS.fieldNames :details1,details2,details3
DETAILS.keyFieldValue : 3
DETAILS.fieldFixedLengths :5,5,5
DETAILS.endSeparator :'nl'
TRAILER1.fieldNames :trailer1
TRAILER1.keyFieldValue : *S
TRAILER1.fieldFixedLengths :5
TRAILER1.endSeparator :'nl'
TRAILER2.fieldNames :trailer2,trailer3
TRAILER2.keyFieldValue :SE TRAILER2.fieldFixedLengths :5,5
TRAILER2.endSeparator :'nl'
File is :
H1hh1hhhhhhhhh2
*Ddd*
Xddd1dddd2dddd3
Xddd4dddd5dddd6
Xddd7dddd8dddd9
*Sss*
SEKss2
in RWB, Channel CC_FILE_Sender_FccDemo: Empty document found. Proceed without sending message
I think the problem is in FCC paramters..
Could please have a look and correct me
Regards
RamRam,
The problem which i can see is your key field values in your test file. Remember you should have the key field value in each new line at the same place.
For example you have given your text file as shown below...
File Given By You is :
>H1hh1hhhhhhhhh2
>*Ddd *
>Xddd1dddd2dddd3
>Xddd4dddd5dddd6
>Xddd7dddd8dddd9
>*Sss *
>SEKss2
Compair the above file with the below one..
>H1hh1hhhhhhhhh2
>*Ddd *
>Xddd1dddd2dddd3
>Xddd4dddd5dddd3
>Xddd7dddd8dddd3
> *Sss *
>SEKss2
If you notice, for details I have given key field value 3 in each line & at same place.
One more thing just use the KeyFieldName only one ( just follow the same blog which I have given, to understand how to use the KeyFieldName )
e.g.
Document Name :MT_File
Document Namespace :urn:test:FileFcctoIdoc
RecordSet name :
RecordsetStructure :HEADER1,1,HEADER2,1,DETAILS,*,TRAILER1,1,TRAILER2,1
RecordSet Structure: Ascending
RecordSet Per message : *
Key Field Name : KF
Regards,
Sarvesh -
File Content conversion - IDOC to Fixed length File
Hi,
Scenario : SAP R/3(IDOC) -> XI -> Fixed Length file
IDOC is sending from SAP R/3, XI has to do the mapping and send a Fixed length File to /tmp in XI.
When I am using the message Protocol as "File" in the Receiver communication channel, XML file is writing to /tmp. When I am using "File Content Conversion" as a message protocol,Empty File is writing. Can anybody tell me why empty file is creating. Can we use File content Conversion in this scenario. Is there any additional parameter or settings required?
Receiver communication channel settings:
Message Protocol: File Content Conversion
File type : Binary
Recordstructure : MT_V_PER01
Name Value
MT_V_PER01.fieldFixedLengths 25,35
MT_V_PER01.fieldNames PERSNR,NAME
File Data Type : DT_V_PER01,
Message type : MT_V_PER01
IDOC type : WP_PER01.
Expecting your expert advice.
Thanks
vineeshHi Moorthy,
I am getting success messages in Audit log as below:
2006-09-29 12:08:53 Success Trying to put the message into the send queue.
2006-09-29 12:08:53 Success Message successfully put into the queue.
2006-09-29 12:08:53 Success The message was successfully retrieved from the send queue.
2006-09-29 12:08:53 Success The message status set to DLNG.
2006-09-29 12:08:53 Success The message was successfully transmitted to endpoint http://nslcxi08:8010/sap/xi/engine?type=entry using connection AFW.
2006-09-29 12:08:53 Success The message status set to DLVD.
2006-09-29 12:08:53 Success The message was successfully delivered.
I have checked the Payload maindocument,the IDOC structure contains data.
<?xml version="1.0" encoding="UTF-8" ?>
- <WP_PER01>
- <IDOC BEGIN="1">
- <EDI_DC40 SEGMENT="1">
<IDOCTYP>WP_PER01</IDOCTYP>
<MESTYP>WP_PER</MESTYP>
<STDMES>WP_PER</STDMES>
<SNDPOR>SAPLCD</SNDPOR>
<SNDPRT>LS</SNDPRT>
<SNDPRN>LCDCLNT210</SNDPRN>
<RCVPOR>LXDCLNT250</RCVPOR>
<RCVPRT>LS</RCVPRT>
<RCVPRN>LXDCLNT250</RCVPRN>
</EDI_DC40>
- <E1WPP01 SEGMENT="1">
<PERSNR>0000100006</PERSNR>
- <E1WPP02 SEGMENT="1">
<NAME>Consumer</NAME>
</E1WPP02>
</E1WPP01>
</IDOC>
</WP_PER01>
Thanks
Vineesh -
Content Conversion- Same keyfield value for two different sub structure
Hi,
I have a scenario where the key field value for the 2 substructure of record structure is same.
MY XML structure is like this :
<documentName>
<recordset>
<Header>
<field-nameA1>
<field-nameA2>
<field-nameA3>
<ITM1>
<field-nameB1>
<field-nameB2>
<field-nameB3>
<ROW1>
<field-nameB1>
<field-nameB2>
<field-nameB3>
<ITM2>
<field-nameB1>
<field-nameB2>
<field-nameB3>
<ROW2>
<field-nameB1>
<field-nameB2>
<field-nameB3>
The sample text file is given below where line no. 3 and 5 are different substructure(For ROW1 and ROW2 respectively) with same keyfield value.
"HDR",399,"file",20050302,100642,3289
"ITM1",2,3,4,5,6,7,8,9,10
"ROW",3,4,5,6
"ITM2",2,3,4,5,6,7,8,9,10
"ROW",7,8,9,10
After content conversion I get a XML structure in which there is no ROW2 and all data within the fields of ROW2 are put under ROW1 as the key field values are identical.
In the records only the first field is constant (e.g. ROW).
How to handle such a scenario?
Regards
Satish ChauhanUnless you can somehow expand the key, I don't know that this is possible. The key implies uniqueness - and in your case, unfortunately, it isn't. Is there any way to edit the structure to make it more unique for you? Do you have any control or ability to change that?
Maybe if you add unique keys in your mapping, you can strip them off with content conversion on the way out using the parameter keyFieldInStructure=ignore? -
Content conversion without delimiter and key fields
I am pretty new to XI, so it has been very challenging till now... (and someway I want to keep it that way) But this problem has kept me awake a couple of nights, so I will unleash it to the XI experts at SDN!
I have to read a legacy file (customers are ordering stuff) with the following content into XI. I finally found out you can use file content conversion to do the job, but I have only seen scenarios where people can use delimiters or key fields so far. I suppose XI can do this job as good as the others, but the question is how it has to be done! :-s
Do I have to use key fields? Or can I simply state there will be 1 header line, X order lines, 1 EOF line?
Sample content:
100207.310551
0107299700001
0108658400001
0109575600001
1200276500001
0109745600001
9999999999999
Header line containing the customer (100207) and the ticket number (300551) separated by a dot.
In this case 5 order lines containing material (8 digits, ex 01072997) and quantity (5 digits, ex 00001)
Line containing only 9's to indicate the end of the file has been reached.
Thanks in advance!
SvenHi Sven,
This FCC might help u..If your structure like ...
<?xml version="1.0" encoding="UTF-8" ?>
<ns0:bestin xmlns:ns0="http://test.com">
<recordset>
<header>
<client>100207</client>
<ticket>310551</ticket>
</header>
<item>
<material>01072997</material>
<quantity>00001</quantity>
</item>
<item>
<material>01086584</material>
<quantity>00001</quantity>
</item>
<item>
<material>01095756</material>
<quantity>00001</quantity>
</item>
<item>
<material>12002765</material>
<quantity>00001</quantity>
</item>
<item>
<material>01097456</material>
<quantity>00001</quantity>
</item>
</recordset>
</ns0:bestin>
then
RecordStructure----header,item
otherwise
RecordStructure----client,ticket,item
client.fieldFixedLengths----give length of client
ticket.fieldFixedLengths----
item.fieldFixedLengths----
client.fixedLengthTooShortHandling--Cut
ticket........same
item.....
client.addHeaderLine--0
ticket........same
item.....
recordsetStructureOrder---var
Cheers!
Samarjit
Message was edited by:
Samarjit Dey -
.csv file Vs .txt file Content conversion sender file channel
Hi Experts,
I have a file with filename say input.csv.I want to do content conversion for these .CSV file.Is it same like we have to do for .txt file say input.txt.
when i open my .csv file in notepad, i get multiple rows with each field separated by ';'.what are the content conversion parameters we have to define for .csv file and can we mention input.csv as the file name as a source file name.
Thanks
DeepakHi,
Use the following parameters for Sender file channel in case of reading .csv file
Recordset Structure.fieldSeparator -
Recordset Structure.endSeparator -
'nl'
Recordset Structure.fieldNames -
provide field names separated with ,
Regards
Seshagiri -
File content conversion Receiver with no key fields
hi all,
I have a header structure with four fields all varying and also item structure with varying fields .. how do i go about to solve this .. as the regular Content Conversion uses key fields.. but there are no such key fields here... kindly help in this regard to proceedIf you dont have a key field, then the only option to read the file and convert it to XML would be in a record row format.
Here each line will go as one field in the XML. You will have to use some logic in your mapping to extract the right field.
Ref: /people/sravya.talanki2/blog/2005/08/16/configuring-generic-sender-file-cc-adapter
but in case your is a receiver File adapter then key fields are not required.
ref: /people/arpit.seth/blog/2005/06/02/file-receiver-with-content-conversion -
File Content Conversion : Sender Channel
Hi
I am trying to do content conversion in the Sender Channel from a flat file to a XML.
My Target XML(message structure) looks like
<H1>
<H2>
<D>Detail Record</D>
<L1>line</L1>
<L1>line</L1>
</H2>
<H2>
<D>Detail Record</D>
<L1>line</L1>
<L1>line</L1>
</H2>
</H1>
Here the element <H2> is only needed to group <D> and the following <L1> elements of each new occurrence of <D>.
Now my problem is that the element <H2> is not getting created.
and the message after content conversion is looking as follows
<H1>
<D>Detail Record</D>
<L1>line</L1>
<L1>line</L1>
<D>Detail Record</D>
<L1>line</L1>
<L1>line</L1>
</H1>
What should I do to get the desired result.@Yes Bhavesh you are right.
Hi Jai,
I am trying the other way round.i.e from flat file to a XML message.As I said I was trying to do it for Sender Channel where is the after content conversion I want a XML file.The example is a what I framed out of my actual problem.
if flat file is as follows ,
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
DetailRecord1
Line1
Line2
Line3
DetailRecord2
Line4
Line5
then the XML must look like
<H1>
<H2>
<D>DetailRecord1</D>
<L1>Line1</L1>
<L1>Line2</L1>
<L1>Line3</L1>
</H2>
<H2>
<D>DetailRecord2</D>
<L1>Line4</L1>
<L1>Line5</L1>
</H2>
</H1>
I identify the different types records in the flat file
as follows,
Record starting with "Detail" is considered as <D> element
Record starting with "Line" is considered as <L> element.
Hope I did clarify. -
Strange Problem with File Content Conversion (Sender)
Hi,
I have a strange problem. I have a sender file adapter with content conversion (csv -> xml). The adapter produces the following error during the processing...
- 2006-02-06 16:34:00 CET: Error: Conversion of part of file content of 'OE_Extractor_47_ISW112_SC-Ireland.csv' to XML format failed around position 1202: IOException: Stream closed
After the 4th or 5th try the adapter processes the file correctly.
Why does it works after several tries and not at the first time? (The file is not changed during the adapter is trying to convert it)
Thanks
ThomasI found the problem, something was wrong with the ftp server
-
Content conversion sender multi levels
hi,
i need to map a flat file to this structure:
header : 1..1
item: 0..unbounded
item_header : 1..1
item_data: 0..unbounded
field1 : 1..1
field2: 1..1
field3 : 1..1
footer: 1..1
how can i achive that with content conversion and what should i write in the field recordset sttructure?
thanks in advance
TomerHi,
With the FCC alone u cant achive this nested structure. You have to handle this in your mapping.
XI/PI: Convert Flat File to Deeply Nested XML Structures Using Only Graphical Mapping By Riyaz Sayyad
>>what should i write in the field recordset sttructure?
It is basically the field name and its occurance like
header,1,item,,item_header,1,item_data, and so
Thanks
SaNv... -
File Content Conversion: Sender Problem
Hi,
I'm getting a very typical error in my Sender Communciation channel.
Channel CC_FILE_SENDER_2: Empty document found. Proceed without sending message
I've gone through a few threads and I know that the problem is with the Key Field and using * in the Recordset Structure but I cannot solve it. If I use * in the Recordset structure it fails,when I use a specific number it works. Any ideas
Here is my Communication Channel details
Document Name: MT_SENDER
Document namespace: http:\\sender
Recordset Structure: FileHeaderRecord1,1,FileHeaderRecord2,1,FileHeaderRecord3,1,FileDetailRecord,*,FileTrailerRecord1,1
Recordset Sequence: Ascending
Key Field Name: RType
And the configuration:
FileHeaderRecord1.fieldNames: RType,Filler,Code,Filler2
FileHeaderRecord1.fieldFixedLengths: 10,31,6,69
FileHeaderRecord1.keyFieldValue: V
FileHeaderRecord2.fieldNames: RType,Filler
FileHeaderRecord2.fieldFixedLengths: 3,113
FileHeaderRecord2.keyFieldValue: HDR1
FileHeaderRecord2.fieldNames: RType,Filler,Date,File,Filler2,Num,Filler3
FileHeaderRecord3.fieldFixedLengths: 3,2,5,6,21,3,76
FileHeaderRecord3.keyFieldValue: UH1
FileDetailRecord.fieldNames: RType,Filler,TCode,Filler1,Amount,Filler2,ZGC,Filler3,Date,Filler4
FileDetailRecord.fieldFixedLengths: 14,1,2,18,11,18,9,28,5,10
FileDetailRecord.keyFieldValue: 9
FileTrailerRecord1.fieldNames: RType,Filler,TCode,Filler1,Date
FileTrailerRecord1.fieldFixedLengths: 14,1,2,12,5
FileTrailerRecord1.keyFieldValue: UT1
ignoreRecordsetName: true
This is a copy of my file....
VPR456SCL1 852086
HDR1 SED456RD 345344500428 F 04 094520428 BS 09452
UHL1 09452ESBCL1 00000000 004
85208681123787085 000000000000500FREW RTYU POSWS123704375 09452
85208681123787085 000000000000600FREW RTYU POSWS123705307 09452
85208681123787085 000000000000600FREW RTYU POSWS123705671 09452Hi,
problem is in your keyfield value,
FileHeaderRecord1.fieldNames: RType,Filler,Code,Filler2
FileHeaderRecord1.fieldFixedLengths: 10,31,6,69
FileHeaderRecord1.keyFieldValue: V
keyfield name is RType and it is given a fixedlength of 10 characters, but your keyfieldvalue is "V
" which is not 10 char long that is the reason your adapter is failing to pick it.
same for all the other recordsets, the fieldvalue shd match the fixed length given.
Eg:- give keyfieldvalue like this "V ". it will work. -
File Content Conversion (Sender) endSeparator Problem
Hi
i have a flat file like this:
fieldA;fieldB;fieldC;fieldA;fieldB;fieldC;fieldA ...
recordset structure: FIELDS,1
recordset per msg: *
parameters:
FIELDS.fieldNames = fieldA,fieldB,fieldC
FIELDS.fieldSeparator = ;
FIELDS.endSeparator = ;
if i change the endSeparator to 'nl' and then changeing the input file to this:
fieldA;fieldB;fieldC
fieldA;fieldB;fieldC
fieldA ...
it works. i already tried to use another endSeparator like this:
fieldA;fieldB;fieldC:fieldA;fieldB;fieldC:fieldA ...
but it doesn't work. it seems like the adapter is only using 'nl' endSeparator, no matter whats the parameters say.
the error in adapter monitoring:
Error: Conversion of complete file content to XML format failed around position 0 with java.lang.Exception: ERROR converting document line no. 1 according to structure 'FIELDS':java.lang.Exception: ERROR in configuration: more elements in file csv structure than field names specified!
i already tried to use hex separators and found the following thread (best matching tread):
anyone has an idea? Thanks a lot.
Regards
J.
Message was edited by: Jörg Pieper
Message was edited by: Jörg PieperHi
this doesn't work
Regards
J.
Maybe you are looking for
-
Psn code not working. please help
I just bought from a store nearby two 50$ receipt one worked but the other didn't it said not correct or may no longer be valid please check your entry (E-8200012F). I checked it many times but still no use what do I do. And I realy like how you take
-
Thank u Scott Orshan We use the "dispatcher" service because we wanted to supply a general interface to the Client Tier. Do you have some better suggestion? Is it nessary? or, We use a control class to tp_call the service? Scott Orshan <[email protec
-
Can you make changes to the regisirty om OS 10.2.8
I need to get into the registry on my wife's iBook to get her scores from the word game Bookworm and transfer them to her new iBook. Is there such a way with Macs? Any help would be greatly appreciated. Thanks Wayne
-
Compressor creating movs that won't play in Windows
I am trying to make transcode video to play back on an installed HD television set. It is being fed by a Windows XP computer over HDMI using Windows Media Player. I have tried 25 different codecs including avi, wmv and mov. The avi and wmv will play
-
Tandberg mxp 6000 camera auto focus
Hello sir, I saw the issue form Tandberg mxp 6000 camera auto focus. when I zoom the camera it focus image blurring after zoom out fully its blurring few minutes and its clear but its not focus correctly. I change camera and check the d