FIle Adapter Receiver - Content Conversion
I have a xml file as below that I am trying to convert to a simple csv file. All I get is a blank csv file at the ouptput. I tried different setting for the file conversion in the reveiver file adapter. No luck yet. I could write to an output XML file with no problem, so my interface is working!
The SAP Help doesn't provide much info on this. Your help is highly appreciated.
Thnaks.
?xml version="1.0" encoding="UTF-8" ?>
- <ns:PlantMaintenanceMessageType xmlns:ns="http://cs.par/demo/plantmaintenance">
<EquipmentID>10005661</EquipmentID>
<FunctionalLocation>KB</FunctionalLocation>
<Date />
<Time />
</ns:PlantMaintenanceMessageType>
What is your root node ?
For your content conversion you need to specify the Recordset Structure but in your case i dont find an entry for the same.
If your XML had an extra tag like
xml version="1.0" encoding="UTF-8" ?>
- <ns:PlantMaintenanceMessageType xmlns:ns="http://cs.par/demo/plantmaintenance">
<b><details></b>
<EquipmentID>10005661</EquipmentID>
<FunctionalLocation>KB</FunctionalLocation>
<Date />
<Time />
<b></details></b></ns:PlantMaintenanceMessageType>
then your record set structure wud be details
and in you content conversion parameters you cud say
details.fieldSeparator -> ,
details.endSeparator 'nl'
I guess you are on sp13 or above hence there even if you content conversion fails a blank file will be created (thats what i have experienced).
Reagrds,
ShaBZ
Similar Messages
-
File Adapter with Content Conversion
Hi -
I am trying to convert a Flat file which has data as
firstnamelastnamecompanyName
Now i have created a message type which has a root name as Contact and its children are FirstName,LastName,Company.
And in the configurator i have created a file adapter with the content conversion, but being very new to XI i have never used a file adapter with content conversion. This is what i have in my Content Conversion Parameters.Please correct my code.
Document Name :: MT_Contact
Document Namespace :: http://venkat
Document Offset :: <i>i did not enter anything here</i>
Recordset Name :: RootNode(i gave this name just like that,,, Should it be something from the IR??
Recordset NameSpace:: <i>i did not enter anything here</i>
Recordset Structure:: Contact (this is the name in my IR
Recordset Sequence :: Ascending
Recordsets per Message :: Contact,* (Can someone explain what should be given here)
Then in the bottom in the name value pairs i have given
Contact.fieldNames = FirstName,LastName,Company
Contact.fieldSeparator = #
When i am using the above configuration the error i am getting in RWB is Error: Conversion initialization failed: Exception: java.lang.Exception: java.lang.Exception: Error(s) in XML conversion parameters found:
Format error in 'xml.recordset' argument: incomplete structure (name,number) pairInvalid 'xml.recordsetsPerMessage' value 'Contact,*' found
I am very new to XI and i am unable to understand what exactly each field means in the file adapter when the content coversion is used. Can someone take the pain of explaining them.
Thank you
VenkatHi,
Use the following to create an XML strucutre like this,
<MT_CONTACT>
<CONTACT>
<FirstName> </FirstName>
<LastName> </LastName>
<CompanyName> </CompanyName>
</CONTACT>
<MT_CONTACT>
DocumentName : MT_TEST
DocumentNamespace : Yournamespace
RecordserName : record
RecordsetStructure : CONTACT,1
In the table,
ignoreRecordsetName : true
CONTACT.fieldNames : FirstName,LastName,CompanyName
CONTACT.fieldSeparator : #
Go through the links suggested by moorthy and also these blogs to understand content conversion better,
/people/anish.abraham2/blog/2005/06/08/content-conversion-patternrandom-content-in-input-file
/people/jeyakumar.muthu2/blog/2005/11/29/file-content-conversion-for-unequal-number-of-columns
/people/michal.krawczyk2/blog/2004/12/15/how-to-send-a-flat-file-with-fixed-lengths-to-xi-30-using-a-central-file-adapter
/people/shabarish.vijayakumar/blog/2006/02/27/content-conversion-the-key-field-problem
/people/sap.user72/blog/2005/01/06/how-to-process-csv-data-with-xi-file-adapter
Regards,
Bhavesh -
Sender file adapter with content conversion Simple XML
Hi experts,
I'm trying to parametrize my sender file adapter content conversion.
I'm receiving a text file with one single line like:
AA1;AA2; AA3;
and I want to convert it to an XML like
<MT_A1>
<field1>AA1</field1>
<field2>AA2</field2>
<field3>AA3</field3>
</MT_A1>
Actually I know how to do somenthing like
<MT_A1>
<LINE>
<field1>AA1</field1>
<field2>AA2</field2>
<field3>AA3</field3>
<LINE>
</MT_A1>
What I want is remove the <LINE> tag from my XML.
Regards
Gonzalo
Edited by: Gonzalo del Castillo on Nov 28, 2008 2:18 PMHi
Use this help document for receiver FCC
http://help.sap.com/saphelp_nw04/helpdata/en/d2/bab440c97f3716e10000000a155106/content.htm
Content Conversion (Pattern/Random content in input file)
File conversion text to xml (Few Last Post) -
Sender File Adapter and content conversion
Hi,
How can we remove the last line from the file using content conversion?
The last line should not be read from the input file.
Like for the first line we can use Document Offset .......similarly do we have any option for the last line?>
neelansha singh wrote:
> date Empno Empname
> 19.03.2009 12345 Neel
> 20.03.2009 34566 Neelkanth
> EmpDes Japan 100
>
>
> The file is like this first row i have removed using document offset.......from 2nd row till nth row the structure is as shown above and the last row has no. of fields 1 less than all other rows and also its root node is different like shown above its rootnode is EmpDes..........How to use File content conversion for this?
do you want to avoid the last line i.e
EmpDes Japan 100
in that case the 3 options are
1. use a adapter module and remove the last line - this is the ideal option
2. use a OS script - will work but only if you are using the NFS option in the file adapter instead of FTP
3. read that also using content conversion (treat it as a trailer) and ignore it during the mapping -
Idoc to File scenario: receiver content conversion
Hi,
I have a Idoc to file scenario in which each segment is to be sent in a new line.
Also, even if the segment is not present in Idoc, comma separated blank values are to be sent.
Till now I have been fllowing this blog
File Content Conversion for Multi Hierarchical Structure
But in this case, blank values csv line are not created.
When I used mapWithDefault for parent WPA12 then only 1 instance is created.
For eg.
WPA01
-WPA02
--WPA12
WPA01
-WPA02
--WPA12
There are no values in WPA12 segment
Output
WPA01,a,a,a,a
WPA02,b,b,b,b
WPA12,,,,,
WPA01,c,c,c,c
WPA02,d,d,d,d
Can I make any change in the approach as in the blog to get the desired output?
Regards,
Anirudh.Hi,
To explain more a bit..
My requirement is to create a flat file from multiple hierarchical xml structure.
Additionally, if the values are not present for some nodes then also I have to send the blank values in flat files. If entire segment is not present then also blank csvs needed to be sent.
regards, Anirudh. -
Hi,
I am facing some problem in FCC for Receiver adapter. It has to convert from XML to CSV File.
<?xml version="1.0" encoding="UTF-8" ?>
- <ns0:PaymentFull_Target xmlns:ns0="http://sdn.com/Payment">
- <RECORDSET>
- <Header>
<LineItem>1</LineItem>
<SaleNumber>102</SaleNumber>
<TransNumber>105</TransNumber>
<Store>1326</Store>
<variant>Z6</variant>
<TransType>NEW</TransType>
<Adjustm_Type />
</Header>
- <Header>
<LineItem>2</LineItem>
<SaleNumber>102</SaleNumber>
<TransNumber>105</TransNumber>
<Store>1326</Store>
<variant>Z6</variant>
<TransType>NEW</TransType>
<Adjustm_Type />
</Header>
- <Header>
<LineItem>3</LineItem>
<SaleNumber>102</SaleNumber>
<TransNumber>105</TransNumber>
<Store>1326</Store>
<variant>Z6</variant>
<TransType>NEW</TransType>
<Adjustm_Type />
</Header>
</RECORDSET>
</ns0:PaymentFull_Target>
Output File is coming only with lineitem values , remaining fields are not coming.
*1,2,3*
FCC Used...
RecordSet Structure -- Header
Header.fieldNames -
LineItem,SaleNumber,TransNumber,Store,variant,TransType,Adjustm_Type
Header.fieldSeparator----- ,
Header.endSeparator----- 'nl'
Did I miss anything.. any idea whats going wrong?
Thanks
DeepthiHi Deepthi,
Mention the occurrence of header in Recordset
You specify like this:
Recordset: Header, *
Header.fieldSeparator : u2018Field Separatoru2019
-->For FCC on Receiver side you donu2019t have to mention the field names.
-->The u2018endSeparatoru2019 parameter needs to given for substructure only
Check this links:
http://help.sap.com/saphelp_nw04/helpdata/en/d2/bab440c97f3716e10000000a155106/content.htm
/people/shabarish.vijayakumar/blog/2007/08/03/file-adapter-receiver--are-we-really-sure-about-the-concepts
/people/arpit.seth/blog/2005/06/02/file-receiver-with-content-conversion
Rgds,
Akhila -
Complex file receiver content conversion
Hi
My challenge is to change this xml structure to a flat file structure using content conversion in a file receiver adapter. My problem is, that I have a record within a record and both records can occur multiple times:
<statusUpdate_response>
<ProcessID/>
<SenderSystem/>
<Results>
<ResultList> (0..unbound)
<OKKode/>
<Reference/>
<Result/>
<ResultDetail> (0..unbound)
<TYPE/>
<ID/>
<NUMBER/>
</ResultDetail>
</ResultList>
</Results>
</statusUpdate_response>
Any suggestions?
Maybe some sort of xml flattener before doing the content conversion would do the trick, but then again how is that to be done?
BR MIkaela small trick might help - /people/shabarish.vijayakumar/blog/2010/01/14/file-conversion-using-nodeception
Also do read - /people/shabarish.vijayakumar/blog/2007/08/03/file-adapter-receiver--are-we-really-sure-about-the-concepts -
File sender adapter and content conversion with polish character
We are loading a csv file with PI 7.0 file sender adapter using "content conversion" - all fields go through EXCEPT a special character hex '208C' (space in front) looks like "Æ" is converted to hex 'C28C'.
We are using code page UTF8
We are using:
enclosuresign "
enclosuresignescape ""
fieldcontentformatting nothing
enclosureconversion NO
Hope some one can helpHi Bohamo,
Hope you have set the following for your file sender adapter :
1. Transfer Mode is set to Binary,
2. File Type Text,
3. Encoding ISO-8859-1( for Western European Latin ).
Inorder to recognize Polish Character, try as follows :
Your sender file after coming into Pi has XML encoding declaration 'UTF-8'.
Write a simple XSLT mapping to change the value of the attribute "encoding" to "ISO-8859-1" in the output XML of message mapping . Include this XSLT map as the second mapping step in your interface mapping.
First step in your interface mapping will be your already existing message mapping.
An example of the XSL code :
<?xml version='1.0'?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method='xml' encoding='ISO-8859-1' />
<xsl:template match="/">
<xsl:copy-of select="*" />
</xsl:template>
</xsl:stylesheet>
or you can also do java mapping if you are comfortable with java code !
Cheers,
Ram. -
Problem in file adapter @ receiver end
Hi ,
I am using file adapter @ receiver end using content conversion.
Using field separator as 'nl'.
When i open file in Hex mode it's showing the field separator as 2 Cariage returns(CR) & 1 line feed(LF).
But the requirement is only 1 CR n 1 LF .
Appriciate ur help..
Regards,
KishoreHi
I tried giving like this,
Datarow.fieldFixedLengths : 15,15,15,15,10,10,10,10
Datarow.endSeparator : '0x0A' or '0x0D'
but da result is same...2 CR n 1 LF..
even if i dont give endseparator then also same thing is happening..
Regards
Kishore -
Problem in Receiver content conversion
Hi All,
I have idoc to flat file, where my reciever is flatfile.
I have a strucutre like below
Header-1.1
Item..1..unbounded.
footer..1..1,
As i am using PI 7.0 , my requirement is to repeat the item segment multiple times.
I am using fixedlengths, to achieve this i have followed like below.
RecordsetStrcture: Header,Item,Footer
Header.fieldFixedLengths:
Header.endSeparator:'nl'
same as for Item,footer..if i am using the above one i could not able to achieve to generate the item segment multiple times.if i give the item,*..it is throwing exception.
Can any one tell...how to achieve the requirement to generate teh item field multiple times.?
Regards,
Sekhar
can you any one tell me ..how do i mention item segment is occuring multiple times in the reciever content conversion.If only one segment is comming then the scenario is working but if the item segment is comming with multiple times, it is throwing error.
Can any one let me know how do we achieve this.
Regards,
Chandu.Hi Chandu,
See this Thread Nested structur for receiver file content conversion
Here see the reply given by Arpit Seth . It is the same problem .
This is the exact solution to your Problem.
I think this is very helpful to you.
And Please gothrough this Blog... /people/shabarish.vijayakumar/blog/2007/08/03/file-adapter-receiver--are-we-really-sure-about-the-concepts
Thanks. -
File adapter @ receiver end using fieldFixedLengths
Hi ,
I am using file adapter @ receiver end using content conversion.
Using field separator as 'nl'.
When i open file in Hex mode it's showing the field separator as 2 Cariage returns(CR) & 1 line feed(LF).
But the requirement is only 1 CR n 1 LF . I tried giving like this,
Datarow.fieldFixedLengths : 15,15,15,15,10,10,10,10
Datarow.endSeparator : '0x0A' or '0x0D'
but da result is same...2 CR n 1 LF..
even if i dont give endseparator then also same thing is happening..
regards,
KishoreHi Kishore,
Try using fieldseparator directly, instead of working around with fixedFieldlength.
cheers,
Prashanth -
How to use File Adapter Receiver to write attachments
Hi,
i have a scenario, in which our own XInotes adapter sends an XIMessage from an IBM Lotus Notes database into XI. This XIMessage contains an XML document as application main document and several PDF files as additional attachments
On the receiver side, i must use a File Adapter to write both the XML documents and the PDF attachments into a directory.
The problem is i don't know how to use the file adapter receiver to write the attachments. In the Channel Monitoring, i can see that all PDF files are transferred to the file receiver. But the file adapter writes only the XML document into the directory.
I've also tried the AF_Modules/PayloadSwapBean, but it can only swap one PDF file into the application payload. And the file name must be hard coded in the module configuration as swap.KeyName.
Could anyone give me any ideas?
thanks a lot in advance
Xianghi,
receiver file adapters do not supprt attachments.
Only File Sender adapter is capable of handling attachments not the receiver.
http://help.sap.com/saphelp_nw2004s/helpdata/en/4b/a20c4cfea96b498b1e1af3f32f0670/frameset.htm
Configuring the sender FILE adapter
The sender file adapter is configured to pick the normal payload (file1.xml), which is specified in the File
access parameters, and the additional image file (file1.jpg) that is to be sent as an attachment is configured
under the Additional File(s) as shown in the screenshot below. The file type would still remain binary.
Since, by default, XI sends payload and attachments in XML format, we need to call two beans, namely the
MessageTransformBean and the PayloadSwapBean to help us is transforming the content to jpeg format
and also change the file extension.
The PayloadSwapBean module is used to replace the application payload of the XI message that holds the
data with another payload which is appended to the message as an attachment. In our case, the payload
would be file1.xml whereas the attachment would be file1.jpg
The swap module is denoted in our scenario with the module key swap. It has two parameters from the
MIME header.
regards,
pradeep. -
File sender with content conversion and ignoreRecordsetName
Him,
I have an scenario with a compressed file sender with content conversion.
In my sender cc i have:
1 AF_Modules/PayloadZipBean Local Enterprise Bean unzip
2 AF_Modules/MessageTransformBean Local Enterprise Bean transform
3 CallSapAdapter Local Enterprise Bean 2
In module configuration, I have also added:
xml.ignoreRecordsetName --> true
But RecordsetName is not removed from XML
Why?
thanks, in advance
CarmeHi,
No need to enter anything in module configuration. Just specify following Name-Value pair in the table provided on the Content Conversion tab of your file adapter.
Add a row with Name = ignoreRecordsetName and Value = true (Both case-sensitive)
For details, see [this link|http://help.sap.com/saphelp_nw04/helpdata/en/2c/181077dd7d6b4ea6a8029b20bf7e55/content.htm].
[some more here|http://www.riyaz.net/blog/index.php/2008/02/20/xipi-file-content-conversion-for-complex-structures/]
Regards,
Riyaz -
File adapter receiver channel is not initialized.
Hi
iam wrking idoc-file scenario, as per the requirement i have created 4datatypes 4 mapping in IR with 4 communaction chanles in ID. the scenarios is working fine with 3 mappings.but in 4 the scenario
the file genaraing properly , i have cheked in SXMB_moni payload but it is not creating in destination system
in runtimeworkbench->message-monitaring-> adpater
i have find the below issues
1) File adapter receiver channel CC_DDPWCS_US_TO_101 is not initialized. Unable to proceed: null Error 2) Exception caught by adapter framework: File Adapter configuration not initialized:
3) Error Delivery of the message to the application using connection AFW failed, due to: File Adapter configuration not initialized:.
please tell me how can i reslove the issue
thanks
niruHi
i have checked the content convertion and changed as below
the structure is
Row.fieldNamesTrans_Id,Order,Item,Product_Id,Product_desc,Lot_nr,Ship_via,Exp_qty,Carousel_loc,compart,Destination,Label
Row.fieldSeparator ,
Row.fieldFixedType char
Row.endSeparator 'nl'
Row.addHeaderLine 4
Row.headerlineTrans_Id,Order,Item,Product_Id,Product_desc,Lot_nr,Ship_via,Exp_qty,Carousel_loc,compart,Destination,Label
even though iam facing the issue. iam wondering "_i have used in the similar structure for other 3 mappings in same scenario those are working perfect "_ but based on condition if 4 th mapping is executed iam facing the problem
error message in RWB/Adapeters
File adapter receiver channel CC_DDPWCS_US_TO_101 is not initialized. Unable to proceed: null
Error Exception caught by adapter framework: File Adapter configuration not initialized:
Error Delivery of the message to the application using connection AFW failed, due to: File Adapter configuration not initialized:.
please help if any of you face the similar situation , i struck-up long ago here
regards
niru -
File Adapter receiver channel : change encoding attribut in xml file
Hi,
How can I change the XML encoding attribut
from:
<?xml version="1.0" encoding="UFT-8"?>
to:
<?xml version="1.0" encoding="ISO-8859-1"?>
in my File Adapter, receiver channel ?Hi,
plz chk the following link:
http://help.sap.com/saphelp_nw04/helpdata/en/14/80243b4a66ae0ce10000000a11402f/frameset.htm
● Select the File Type of the document:
○ Binary
○ Text
Under File Encoding, specify a code page.
The default setting is to use the system code page that is specific to the configuration of the installed operating system.
The content of the message is converted to the corresponding code page before the message is saved as a file.
Permitted values for the code page are the existing Charsets of the Java runtime. According to the SUN specification for the Java runtime, at least the following standard character sets must be supported:
Regards
Maybe you are looking for
-
Creative Cloud is telling me "Unable to reach Adobe servers. Please check your firewall settings, and try again in a few minutes. What do I do to access the cloud? I have checked my firewall settings to allow for me to be able to use adobe cloud. Any
-
Advange of using Adobe Acrobat over Microsoft word 2007 PDF add -in
Hi, I would like to know what is the advantage of using Adobe Acrobat 9 standard or professional over Microsoft Word 2007 PDF addin. Microsoft will ship the PDF convertor with SP2 later this month, in that case what should be the use of using adobe a
-
TL;DR: Be Careful when you Edge up. Has anyone else had a problem with the warehouse “not receiving” the returned the device? How did it turn out? When I heard about the Edge program it was perfect for me. Early upgrades, just return the phone th
-
Error in posing question?
I have been trying to submit a question for days. First it just plain disappeared. Now I'm getting an error message with no explanation. Has microsoft taken over this site?
-
I KEEP GETTING THIS ERROR. PLEASE HELPMainStage 3 was not able to complete the download. Check your internet connection and try downloading again.