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
Tomer
Hi,
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...
Similar Messages
-
Receiver File content conversion for multi level hireachy
Receiver channel file content conversion..
this is SAP proxy to FIle Scenario, which will get invoice details from SAP along with multiple invoice texts for each invoice.
I would like to have below mentioned payload at Target side,
<MT_Invoice>
<File Header> 1...1
<f1> customer invoices </f1>
<f2> 12/02/2010 </f2>
</File Header>
<Invocie header>
<f1> Invoice number1 </f1>
<f2> customer number1 </f2>
</Invoice header>
<Invoice text>
<f1> Inovice no1-text1 </f1>
</Invoice text>
<Invoice text>
<f1> Inovice no1-text2 </f1>
</Invoice text>
<Invocie header>
<f1> Invoice number2 </f1>
<f2> customer number2 </f2>
</Invoice header>
<Invoice text>
<f1> Inovice no2-text1 </f1>
</Invoice text>
<Invoice text>
<f1> Inovice no2-text2 </f1>
</Invoice text>
<Invocie header>
<f1> Invoice number3 </f1>
<f2> customer number3 </f2>
</Invoice header>
<Invoice text>
<f1> Inovice no3-text1 </f1>
</Invoice text>
<Footer> 1..1
<f1> have a great day </f1>
</footer>
</MT_Invoice>
for the above payload file should come as mentioned below
customer invoices 12/02/2010
invocie number1 customer no 1
invoice no1-text1
invoice no1-text2
invocie number2 customer no 2
invoice no2-text1
invoice no2-text2
invoice no2-text3
invocie number3 customer no 3
invoice no3-text1
have a great day
For to get the above payloadI have create a message type like
MT_invoice
header 1...1
f1 1
f2 1
invoice details 0... unbound
f1 1
f2 1
invoice text 0.... unbound
f1
footer 1...1
f1 1
Please correct me if my message type declaration was wrong...
Please suggest how do i need to approach for message mapping and as well as FCC in File adapter...
Edited by: Vidyadhar Kurmala on Dec 2, 2010 10:28 AMIt is not possible to create alternating nodes in graphical mapping tool.
I recommend using the MessageTransformBean for FCC, as this supports a 2-level hierarchy.
Then you add a node record like this:
<MT_Invoice>
<Record>
<File Header> 1...1
<f1> customer invoices </f1>
<f2> 12/02/2010 </f2>
</File Header>
</Record>
<Record>
<Invocie header>
<f1> Invoice number1 </f1>
<f2> customer number1 </f2>
</Invoice header>
<Invoice text>
<f1> Inovice no1-text1 </f1>
</Invoice text>
<Invoice text>
<f1> Inovice no1-text2 </f1>
</Invoice text>
</Record>
<Record>
<Invocie header>
<f1> Invoice number2 </f1>
<f2> customer number2 </f2>
</Invoice header>
<Invoice text>
<f1> Inovice no2-text1 </f1>
</Invoice text>
<Invoice text>
<f1> Inovice no2-text2 </f1>
</Invoice text>
<Invocie header>
<f1> Invoice number3 </f1>
<f2> customer number3 </f2>
</Invoice header>
<Invoice text>
<f1> Inovice no3-text1 </f1>
</Invoice text>
</Record>
<Record>
<Footer> 1..1
<f1> have a great day </f1>
</footer>
</Record>
</MT_Invoice> -
Content Conversion for multi level heirarchy
Gurus,
I have the following scenario
FileXIFile
Input File structure is as follows
FH|............ (occurs 1)
FE|............. (occurs *)
FED|........... (child of FE and can occur * under FE)
FT|.............. (occurs 1)
The file contents are pipe delimited.
Example file
FH|.....
FE|........
FED|........
FED|.........
FE|.......
FED|........
FT|............
As stated above, FED recordtype can occur multiple times under FE
My inbound message structure is
.....Header (1)
........ErrorRecord (0,unbounded)
.............ErrorDataRec (0,unbounded)
.....Trailer (1)
Recordset Structure - Header,1,ErrorRecord,,ErrorDataRec,,Trailer,1
Recordset Sequence - Variable
KeyFieldName - RecordType
Content Parameters
I have defined field separator as pipe for each recordset
I have defined keyFieldValue for each recordset
I have defined fieldNames for each recordset
Here is my problem
The file loads ok. However, ErrorDataRec loads at the same level as ErrorRecord rather than loading under it.
I have played with fieldNames to define ErrorDataRec as a field under ErrorRecord and not definining as one, doesnot seem to make a difference.
I need someway to tell the parser that ErrorDataRec needs to be loaded as a substructure of ErrorRecord.
Anyone has any ideas?
Regards
HaseebVJ,
You are absolutely right it is not possible to get multiple hierarchy using file content conversion.
Splitbyvalue function would not work in my scenario as I need to group FED records based on first few characters in the first column of FED records. I wrote a UDF to insert context change based on the column value.
Thanks again for your help.
Regards
Haseeb -
File Content Conversion for Multi Hierarchical Structure for Sender Adapter
Hi Gurus,
My text file is coming as
Header,filed1,field2(Occurrence=1)
Content,field3,field4(Occurrence =1-Unbounded)
Detail,field4,field5(Occurrence = 1-unbounded)
Trailer,fieldN(Occurrence=1)
My requirement is to write a file content conversion, so that, in the resultant XML Structure the Detail will come under Content.
I have defined the Record Set Structure as
Header,1,Content,*,Detail,*,Trailer,1
But after FCC, the Detailed record is coming in the same level as the Content Record. But the business requires that, the Detailed Record should come under Content Record, so that they can correlate.
Could any one advise?
Regards,
SS
Edited by: Subhendu Sahu on Jun 17, 2011 4:43 PMHi,
Please use the below parameters -
○ NameA.keyFieldValue
Specify the value of the key field for the structure.
This entry is mandatory if the key field name is set. Otherwise, the entry is ignored.
NameA.keyFieldInStructure
■ If the key field of the substructure is to be added to the XML document, enter add. This is the default.
■ If the key field is to be ignored, enter ignore.
http://help.sap.com/saphelp_nwpi711/helpdata/en/44/6713ec3f914ddee10000000a1553f7/frameset.htm
cheers,
Sunil -
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 : 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
-
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, -
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
TomerHi
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 -
.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 (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. -
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 File Adapter - Record Delimeter ~
The inbound file has file has ~ as record delimeter. I am using the FCC at sender file adapter to covert this file into XML. Somehow, the file adapter is not able to interpret "~" as my record delimeter even thoough I specified "record.endSeparator = ~" in FCC.
Would someone help me with a solution?Raju,
You can also try to use the '0x7E' as endSeperator condition.
I am not sure if the HTML tag will work but this should do the trick. This should be the HEX corresponding entry
char description hex char code html
" ~ " "Tilde" "0x7e" "~" &!tilde; (without !)
greets.
in adition to this see SAP help
http://help.sap.com/saphelp_nwpi71/helpdata/en/44/655453b48a4ddfe10000000a1553f7/frameset.htm
Special Characters in Strings for Separators
In all strings for separators (NameA.fieldSeparator, NameA.beginSeparator, NameA.endSeparator), you can specify non-printable ASCII characters. These characters can each be inserted individually in the strings in the form ´0xHH´ (including the quotation marks), where HH represents the character encoded as a hexadecimal value.
Please also ensure that the "recordSet Structure" also need to be configured Correctly
for example:
Header,1,Detail,*
Header.fieldSeperator --> %parameter%
Detail.fieldSeperator --> %parameter%
Detail.endSeparator --> '0x7e'
Greets -
Complex content conversion File sender
RecordSet
>Header 1..1
hfield1 1..1
hfield2 1..1
>/Header
>Detail 1..n
Dfield1 1..1
Dfield2 1..1
> SubDetail 1..1
SDfield3 1..n
> /SubDetail
>/Detail
/RecordSet
My CSV File would be like.
1hfield1,hfield2
2Dfield1,Dfield2
3SDfield3
3SDfield3
2Dfield1,Dfield2
3SDfield3
3SDfield3
2Dfield1,Dfield2
3SDfield3
3SDfield3
I have Used following Conversion Parameter. Please check.
Recordset Structure : Header,1,Detail,,SubDetail,
Keyfieldname : key
Keyfieldtype: string
Header.fieldSeparator ,
Header.endSeparator u2018nlu2019
Header.fieldNames hfield1,hfield2
Header.keyFieldValue 1
Header.keyFieldInStructure ignore
Detail.fieldSeparator ,
Detail.endSeparator u2018nlu2019
Detail.fieldNames Dfield1,Dfield2,SubDetail
Detail.keyFieldValue 2
Detail.keyFieldInStructure ignore
SubDetail.fieldSeparator ,
SubDetail.endSeparator u2018nlu2019
SubDetail.fieldNames SDfield3
SubDetail.keyFieldValue 3
SubDetail.keyFieldInStructure ignore
Suggest , where I am wrong. And what is missing ?????????????????
So . I am not able to convert this SubDetail by using content conversion.
Upto Level Header and Detail , it is coming in xml file . but not for SUBDETAIL and SDfield3.
Please check above config and suggest.
Is there any way to perform such content conversion without using KEVALUE 1, 2, 3 in CC parameters,Thanks Hareenkumar for reply ..
The Blog which you have Given , in that all the substructure is in same hierarchy , But in my case subDetail in Under Detail .
What Can i do for such structure ???.
And Thank You for pointing me on using key under fieldNames .But It was my mistake . I was forgot to write "key" under fieldNames , as i am already using Using it.
Maybe you are looking for
-
Swing GUI isn't showing up properly without resizing window
I am developing a Java GUI with Swing. I have not used any paintComponents or paint commands for anything - all Swing. Every time I run the code, I get the JFrame to come up, but all I can see is the background. Only after I resize the window (manual
-
Why do Sony DSC-RX100M3 raw files look strange in PE9 when flash has been used in the shot?
I have just bought a Sony DSC-RX100M3 camera and use it to shoot raw + jpeg. I want to use the raw files in my Photoshop Elements 9, which has the Camera Raw plug-in version 6.5.0.216 installed. I have downloaded the Adobe DNG converter version 8.7.
-
Hello I wantto rename content type on web site level and underneath all the document libraries using powershell, please let me know how can do this? I saw this url http://suryapulipati.blogspot.in/2011/08/rename-content-type-name-in-list-using.html,
-
Recommendations for a wireless setup
I have a Mac Pro, but it doesn't have any Bluetooth or wireless access. I've been thinking about remedying this so I can use the laptop in the other room or on the couch or... well, y'know. Freedom. The Mac Pro is attached to the internet via cable-m
-
Web logic 12.1.3 issue with calllable statements
Hi All, I have installed weblogic 12.1.3 and working with java 1.8. I'm encountering the following error in logs (snippet of the error) - java.lang.NullPointerException at oracle.jdbc.driver.DynamicByteArray.next(DynamicByteArray.java:817) at ora