How to escape newline character(nl) in file content conversion parameter?
Hi Experts,
How to escape newline character(nl) in file content conversion parameter?
For example:
field1field2field3
field4field5field6
Means Item is splitted in two lines.
I want to SKIP new line character
and to collect all SIX fields.
What will be the file content conversion parameter?
Thanks in Advance..........
Hi,
as far as i know there is nothing in the standard. But the question is why dont you combine at mapping the fields into only structure?
Regards,
Udo
Similar Messages
-
How to remove the footer in the file content conversion
HI
I have receiver structure like this
<Mt_test>
<Node1>
<test1>name1</test1
<test2>name2</test2
<footer>
<test3>name3>
This is the structure. footer segment we need in pay load. so we can't skip anything in the mapping. But target we are using File content conversion. i want to remove the last footer segment in the file. Please help me this.
thanks
SamHi Satish,
Thank for your quick replay.
attached payload i am receiving after the mapping. i need to eliminate footer node in my file.
Output should be like this.
20100201,200,2345.00
20100218,201,2345.00
But out put i am getting like this
20100201,200,2345.00
20100218,201,2345.00
test0001---> should be remove this in the output file.
Payload:
<ns0:MT_google xmlns:ns0="http://google.com/xi/google">
<Datarow>
<CALDAY>20100201</CALDAY>
<PLANT>200</PLANT>
<ZSTR_PLANT>2345.00;/ZSTR_PLANT>
</Datarow>
<Datarow>
<CALDAY>20100218</CALDAY>
<PLANT>201</PLANT>
<ZSTR_PLANT>2345.00;/ZSTR_PLANT>
</Datarow>
<Footer>
<FileName>test0001</FileName>
File content conversion:
Datarow.endSeparator ='nl'
Datarow.fieldseparator = ,
Footer.fieldfixedLenghts =0
Footer.fieldlengthTooShortHandling= Cut
Please suggest me anything to change.
Advanced Thanks
Sam
</Footer>
</ns0:MT_google> -
XML file conversion after sender file content conversion
Hi,
I have issue refarding file content conversion.
My input structure is
<MT_RCICrecords>
<TRNH>
<RCIC>
<RECH>
<RECL>
<RCIC>
<TRNH>
Afetr sender File content conversion (csv to xml) it produces xml file as below (since file conversion does not support 3rd level of hierarchy)
<TRNH>
<RECH>
</RECH>
<RECL>
</RECL>
</TRNH>
It does not recognize RCIC.
Now i am trying to map this to IDOC and getting error as
'MT_RCICRecords tag found instead of IDOC BEGIN ='.
CAn anyone suggest me how to chaage this xml output after File content conversion to add RCIC tag in xml file?
I am new to XI so please give me some sample code to.
Thanks.
Yashpal
Its urgent!My problem is xml generated from content conversion is like below
<MT_RCICrecords>
<TRNH></TRNH>
<RECH></RECH>
<RECL></RECL>
<TRLR></TRLR>
</MT_RCICrecords>
and i want it to be
<MT_RCICrecords>
<TRNH></TRNH>
<RCIC>
<RECH></RECH>
<RECL></RECL>
</RCIC>
<TRLR></TRLR>
</MT_RCICrecords>
which is not happening
My input message structure is
MT_RCICrecords
TRNH
RCIC
RECH
RECL
i hope it is clear now
TRLR -
File Content Conversion in Receiver Adapter Help
Hi,
I need to have a flat file at receiver side with the following structure.
Product
LineItem
Notes
Product
LineItem
Notes
But i am getting as
Product
Product
LineItem
Notes
Notes
Please suggest me the changes to be made in File Content Conversion Parameter
Your Help will be appreciated.
Thanks in advance,
AshokSingh,
I think we wont give field names in the receiver file adapter. Please find the details below:
RecordSet Structure: Product,LineItem,Notes.....
Parameters:
Product.fieldFixedLengths:30,10...
Product.endSeparator:'nl'
LineItem.fieldFixedLengths:30,10..
LineItem.endSeparator:'nl'
Notes.fieldFixedLengths:30,10...
Notes.endSeparator: 'nl'
Thanks
Ashok -
How to remove a character in a file??
I'm not getting how to remove a character from a file.Could anyone post a method to do this?Any help would be appreciable.
Ohhh... and one more thing... unless you're really unlucky, a few "extranious trailing nulls" won't make a jot of difference to the size of the file on disk, each each file "fills" whole blocks anyway, which is 1K (I think) on both fister and *nix... unless of course we're talking "lots" of trailing-nulls, or lots-and-lots of files.
-
Receiver File Adapter: Problem with NewLine Content Conversion Parameter
Hello Everybody
On our SAP-XI (SAP NetWeaver 2004s, sp14) I have the scenario to send a price catalogue (IDoc PRICECATALOGUE.PRICECATALOGUE02) from SAP R/3 as csv PRICAT file to a file share.
In the receiver communication channel I have defined
Message Protocol = File Content Conversion
using the following RecordSet:
RecordSet = HeaderRow,MainBody
One header row is followed by one or more main body rows. The csv PRICAT message format demands that there is an empty row (i.e. one carriage return) between header and main body and another carriage return after the last main body row:
<Header Row>
carriage return
<MainBody 1>
<MainBody 2>
carriage return
As content conversion parameters I tried to use NewLine ('nl') to create the carriage returns in the file:
HeaderRow.fieldSeparator = ,
HeaderRow.endSeparator = 'nl' " new line
MainBody.fieldSeparator = ,
MainBody.endSeparator = 'nl'
Using the settings I have been able to created the carriage return at the end of the file but not the one between header and main body.
As workaround I have used the following approach:
" Add the following XSLT mapping between header and body:
<SeparatorLine>
<value>
<xsl:value-of select=" '' "/>
</value>
</SeparatorLine>
RecordSet and parameters have been changed accordingly:
RecordSet = HeaderRow,SeparatorLine,MainBody
HeaderRow.fieldSeparator = ,
HeaderRow.endSeparator = 'nl'
SeparatorLine.fieldFixedLength = 0,0 " sic!
MainBody.fieldSeparator = ,
MainBody.endSeparator = 'nl'
Has anybody an idea why I failed to receive the first carriage return and has somebody a more elegant solution?
Kind Regards
UweHi,
Thanks for reply. I have already used 'nl'.
When i open into the notepad it is showing [] boxes rather then new line.
e.g. 1 [] 2 []
but when we open into wordpad it opens properly.
Customer wants when he opens in notepad it should show line by line.
e.g.
1
2
How should i convince to customer ? -
** File Content Conversion Error in Receiver CC - How to solve this?
Hi friends,
My target structure looks like below.
EmployeeJobDetails --> Message Type
JobCode --> Node
EmployeeNumber xsd:string
Domain xsd:string
JobTrack --> Node
Department xsd: string
Position xsd: string
I use the FCC parameters in the receiver CC as below:
Recordset Structure: JobCode,JobTrack
JobCode.fieldSeparator = |
JobCode.endSeparator = 'nl'
JobTrack.fieldSeparator = |
JobTrack.endSepartor = 'nl'.
Because, we want the output like below
1099|Raja
Accts|JuniorAccountant
1100|Ram
HR|Recruiter
like this.
In this scenario Source is XML and target is txt file.
I am using XSLT Mapping. The FCC works fine, if my source input file contains some records. But, when we send empty source XML file as below
<?xml version="1.0" encoding="UTF-8"?>
<EMPLOYEE_DATA/>
Mapping works fine. Message is processed successfully in SXMB_MONI. The payload in response also comes with Message Type name like below
<EmployeeJobDetails namespace >
</EmployeeJobDetails>
While convert this, the system throws below error.
Error Message:
Message processing failed. Cause: com.sap.aii.af.ra.ms.api.RecoverableException: Exception in XML Parser (format problem?):'java.lang.Exception: Message processing failed in XML parser: 'Conversion configuration error: Unknown structure '' found in document', probably configuration error in file adapter (XML parser error)': java.lang.Exception: Exception in XML Parser (format problem?):'java.lang.Exception: Message processing failed in XML parser: 'Conversion configuration error: Unknown structure '' found in document', probably configuration error in file adapter (XML parser error)'
Friend, how to convert this when source XML is empty.
But, if we remove JobTrack node in target strucutre and remove the JobTrack parameters in CC, then if we send the same empty XML file FCC is working fine and we get the target text file 0 KB. (Amazing !!)
But, in the first case, how to solve the issue?
Kind Regards,
Jegathees P.Hi friends,
If we remove JobTrack node in target strucutre and remove the JobTrack parameters in CC, then if we send the <b>same empty XML file</b> FCC is working fine and<b> we get the target text file 0 KB</b>. (Amazing !!)
But, if we give parameters like JobCode,JobTrack then send pass the same empty file, we face the problem 'File Content Conversion' Error.
Searching solution for this problem ... -
How to debug file content conversion problems?
Hi,
I'm trying to debug a file content conversion problem. I'm mapping a few nodes in an IDOC to a file of fixed length fields. I'm using the "<Node A>.fieldFixedLengths", "<Node B>.fieldFixedLengths", "<Node C>.fieldFixedLengths", etc. parameters to specify the fixed length records.
However, a certain node (for e.g. Node B) is causing a problem and if it is present in the IDOC, the output file does not get created. Upon checking the XI monitor, I notice that the file gets mapped correctly and thus the problem lies when the file adapter does the file content conversion. How do I debug this because there is no descriptive error in the XI log? If this node is not present, the file gets generated fine.
Thanks,
Basant GuptaHi,
If your SXMB_MONI shows, success status, then go to RWB->Message Monitoring->Message display tool and then check Audit log for the analysis,
So it wil help you debug the situation.
If there is no error, then check RWB->Component Monitoring->Adapter Monitoring for you file communciation channel..
/people/michal.krawczyk2/blog/2005/01/02/simple-adapter-and-message-monitoring
Regards,
Moorthy -
How can i make calculation in two file using two parameter
how can i make calculation in two file using two parameter
Solved!
Go to Solution.i am having two differnt file, both file having no and time , i want to make programme that when, number and tiome is same in both file give that index onle in , i am going to attached the file
Attachments:
iisc11-jan2010extract.txt 1253 KB
sp3.xlsx 12 KB -
Error in Sender File content Conversion - how to ignore keyfieldName
Dear Frndz,
I'm new to SAP PI. I want to post a flat file to ECC.
The Souce Structure is:
Record(1-unbounded)
|_Header(1.1)
field1
field2
field3
|_Detail(1.unbounded0
field4
field5
field6
Sample File:
first header - xx,yy,zz
Detail 1 - 1,b,c
Detail 2 - 2,e,f
second header - aa,bb,cc
Detail 1 - 1,g,d
I wrote the file content conversion as follows
Recordset name - Record
Recordset Structure - Header,1,Detail,*
Header.fieldNames field1,field2,field3
Header.feldseparator ,
Header.endseparator 'nl'
Detail.fieldNames field4,field5,field6
Detail.fieldseparator ,
Detail.endseparator 'nl'
Conversion initialization failed: java.lang.Exception: java.lang.Exception: java.lang.Exception: Error(s) in XML conversion parameters found: Mandatory parameter 'xml.keyfieldName': no value found
It's asking me to give the input to keyfieldname. But I dont have such field in my record. Ther's no common field . no field is repeating like record type or doc_type as in other cases.
So, Coud you please guide me to proceed with this.
Thanks in advance.....Hi,
Please, take a look to these Blogs related to FCC
Troubleshooting the File Adapter (Last Updated on 02 July'10)
Content Conversion (Pattern/Random content in input file)
File Content Conversion for Unequal Number of Columns
The specified item was not found.
Content Conversion ( The Key Field Problem )
NAB the TAB (File Adapter)
Rgds
RP-. -
How to handle the whitespace in receiver file content converion
Hi Experts,
In Receiver file content conversion we are facing issue with white space charecters- lets example value -999, but in receiver field fixed lengh we have defined as 20 lengh as per the requirement. But, in the output file we are getting [negative sign taking as first char and value filling last] - ********* 999. ****** are white space charecters.
Is there any content conversion paramter for avoiding this type of white space charecters in receiver file content conversion ?
Best Regards.
Krushi.hi All,
I presume that there is something missing UDF coding as per the below.
please advise on this.
input to conversion of 437.72- to -437.72 is mapping is executing correclty. but, receiver file content conversion we have defined as amout value as 20.
so -ve sign taking first place char and remaining moving to last charecters, and whitespaces are filling in the middle.
Now i need to do the trailing of white space charecters. I have tried all above suggested options but nothing works.
for(int count=0;count<input.length; count++)
if(input[count].endsWith("-"))
result.addValue("-"+input[count].substring(0,input[count].length()-1));
else
result.addValue(input[count]);
Thanks and Regards,
Krushi. -
File content conversion using SOAP adapter
Hi,
I'm using a receiver SOAP adapter in my IDOC to file scenario and need to do file content conversion in the receiver side.
Are any standard modules available for file content conversion in the SOAP adapter or do I need to write custom EJB modules for this.
Please note that I have to use a SOAP adapter, can't use any other adapter.
Thanks in advance
ShiladityaHi,
XML Document Conversion Type
● Enter recordTypes as the parameter name.
Under Parameter Value, enter the complete, comma-separated list of all names of recordset types that occur in the document to be converted.
If you decide to use this method, you can define a different conversion type for each recordset type that occurs in the XML document.
For example, you could name the recordset types as follows: RecordType1,RecordType2,RecordType3.
● Enter singleRecordType as the parameter name.
Under Parameter Value, enter the name of a recordset type that is to be used to convert all elements that occur in the XML document.
If you decide to use this method, define the same conversion type for each recordset type that occurs in the XML document.
You must enter exactly one parameter only. Whichever parameter you choose, you automatically exclude the second parameter.
You define further parameters for each recordset type.
In the remainder of this documentation the parameters are specified by the prefix <RecordType>. In your configuration, replace this name with the name of the recordset type.
Conversion Type List with Separators
● <RecordType>.fieldSeparator
Enter the field separator that is written between the individual fields of a record.
This specification is mandatory.
Conversion Type List with Fixed Field Length
● <RecordType>.fieldLengths
Specify a character string that contains a list of fixed field lengths that are separated by commas and which determines the number and the length of fields generated in the text file.
For example, you want to write a recordset with three elements that have field widths of five, ten, and fifteen characters. Enter:
<RecordType>.fieldLengths = 5,10,15
This specification is mandatory.
● <RecordType>.fieldLengthExceeded
Specify how you want to handle fields that exceed the configured field length. Permitted values for the parameter value are:
○ error (default)
Interrupts processing of message with error
○ cut
Cuts off superfluous characters
○ ignore
Ignores the field length restriction
Further Entries
● <RecordType>.beginSeparator
Enter a string. The string is placed in front of the first field of a recordset.
● <RecordType>.endSeparator
Enter a string. The string is appended to the last field of a recordset as a concluding character. The default is \r\n.
● contentType
Enter the MIME type of the converted payload. The default value is text/plain.
● addHeaderLine
Only define this parameter if you have already defined singleRecordType.
Define whether a header line is to be added to the result of the conversion.
○ none (default)
Does not insert a header line
○ fromXML
The header line is generated from the element name of the first recordset of the XML document
○ fromConfiguration
The header line is determined by the configuration parameter headerLine.
● headerLine
Only define this parameter if you have already set addHeaderLine=fromConfiguration.
The value that you define is placed in front of the result of the conversion as a header line.
● fixedLineWidth
Enter the maximum line length n (in characters) that can be written to the resulting document. The separator specified by lineSeparator is inserted in the resulting document every n characters.
● lineSeparator
Only define this parameter if you have already defined fixedLineWidth.
Specify the string that is written to the resulting document at the end of each line that is written with fixedLineWidth. The default is \r\n.
Use of Special Characters
You can use special characters in the following parameters: <RecordType>.fieldSeparator, <RecordType>.beginSeparator, <RecordType>.endSeparator, headerLine, and lineSeparator.
● Tabulator: \t
● Carriage Return (CR): \r
● Line Feed (LF): \n
● Arbitrary character: \x<code>
<code>indicates the hexadecimal character code of the character to be displayed.
Regards,
Phani -
Hi ,
My Scenario is File to FIle having Sender .CVS using File Content Conversion
The sender file is coming below as an example,
a,b,"c,d,e",f
Here I need to consider Double code value "c,d,e" as a single field value using File separator as COMMA(,)
Please guide me how to achieve this type of file using FCC with file separator COMMA.Hi Dilip,
We had a similar problem where the name for eg: "John,Smith" when written into a .csv file were considered as "John","Smith" as two different entities instead of one. The solution was we used the character quotes " before and after the name field message mapping before it is sent to channel for .csv conversion as shown in the screenshot. Now it is treated as one single filed instead of two.
Hope this helps!
Thanks,
Divya. -
File content conversion on Sender Side
Hi,
I am doing file content conversion on sender side.when i am executing the scenario,i am getting the following error in sxmb_moni:
Invalid at the top level of the document. Error processing resource 'file:///D:/Documents and Settings/...............
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?><!-- Inbound Message --> DOC_HEADER ...
when i right click on the pyaload and select view source
its displaying the whole flat file with the following line at the beginning:
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?><!-- Inbound Message -->
i have given all the parameters correctly....
in sxmb_moni.....the error category is Mapping and the error id id EXCEPTION_DURING_EXECUTE
Please help me with this error.
thanks n regards,
anuradhaHi !!
The best way to debug would be to add TRACE statements in your mappigs. In both Graphical and java Mapping.
Trace out the entire output of java mapping and see if this is the input that the next mapping expects.
For trace , http://help.sap.com/saphelp_nw04/helpdata/en/c8/98e7d5c1620642973565ea3dd319d1/content.htm
refr this links also
Fatal Error: com.sap.engine.lib.xml.parser.ParserException: Name expected
unsported character error in message mapping
Re: HTTP to RFC Mapping error:com.sap.aii.utilxi.misc.api.BaseRuntimeException:
Exception com.sap.aii.utilxi.misc.api.BaseRuntimeException
Re: Outbound error
Re: mapping error
error in file to file
have a look at this weblog on how to test your mapping
/people/michal.krawczyk2/blog/2005/09/16/xi-how-to-test-your-mapping-in-real-life-scenarios
Thanks !!! -
Problem with end seperator in file content conversion parameters
Hi All
I have a proxy to file scenario, and i am writing the file using file content conversion.
In my message type, there can be multiple object records in a single data record, as shown here:
<Data_Record>
<Field1>111</Field1>
<Field2>222</Field2>
<Object_Record>
<Field3>333</Field3>
<Field4>444</Field4>
</Object_Record>
</Data_Record>
Recordset Structure: Data_Record, Object_Record
Content conversion parameters:
Data_Record.fieldseperator: ,
Data_Record.end_seperator: 'nl'
Object_Record.fieldseperator: ,
Object_Record.end_seperator: 'nl'
My requirement is, every data record should be followed by new line character and every object record should be followed by new line character:
111,222(new line character)
333,444(new line character)
But, my current output is:
111,222,333,444(new line character)
The problem is, as the data record ends only after object record, i am getting new line character only after object record. (technically, the end tag of data record occurs only after the end tag of object record).
Now, how can i get a new line character after data record and after object record?
Thanks
ChandraHi Sekhar,
We know the input which you are trying to use(in XML ).
Can you please tell us the output which you are expecting here after using ContentConversion at receiver side.
Regards,
Prakash.
Maybe you are looking for
-
Hello ABAPers, i want to develop a program which will take the Program name as input and output will be list of all variables which are used in the program. i want to use this list for some other purpose. The output list should contain all variables
-
Javax.jms.InvalidSelectorException occurs when upgrade to weblogic 12c
Recently, our team upgrade weblogic server from 11g to 12c, some errors occur when start web application in weblogic domain. The error is related to message driven bean, below is the part of ejb-jar.xml definition: <message-driven id="message-dr
-
When iPod touch is connected in iTunes
I cannot change the layout view. Anyone know why? Grid or cover flow are greyed out and i cannot change it. Thanks.
-
Image of building with edges added
there are fine lines put on the edges of these buildings and other object in this picture using photoshop.. i'm new to photoshop and i can't find anything in help about line edges.. can someone please tell me the steps for doing this? please no techn
-
Recommended version of BO 4.1
Hi, we are using BO4.0 SP7and we are going to upgrade to 4.1 but we don't know which version should we choose. I read somewhere that SAP recommend some version and SP. Has anybody heard about it? Or which version do you recommed? We are going to use