Remove of quotes"' in the sender file adapter -- file content conversion
HI Guys,
MY source file is comma seprated file (,) in the file i had quotes" " for the data like
"5000543","0.00","03/04/2009",
is there any way i can remove the quotes in file content conversion
Please help me on this
Regards
Srinivas
Srinivas,
This should not be a big deal, because your fields are separated by a comma. So you need to keep in mind like you are doing the content conversion for a csv file.
See this blogs for some information:
/people/venkat.donela/blog/2005/03/02/introduction-to-simplefile-xi-filescenario-and-complete-walk-through-for-starterspart1
/people/venkat.donela/blog/2005/03/03/introduction-to-simple-file-xi-filescenario-and-complete-walk-through-for-starterspart2
In the second blog 1345 there are parameters for content conversion. So similarly mention your conversion parameters in your sender communication channel. So after converting to xml your input fields have values like:
field1: "5000543"
field2: "0.00"
field3: "03/04/2009"
So all your field values has with "". Now you can use either standard replace funciton or a udf as given above and then it will remove the quotes and then you can map according to your requirements. If you think sometimes you can get quotes and sometime not in the file then you can use function like startswith or endswith along with exists and can map accordingly.
Regards,
---Satish
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 -
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 -
How to process a text file (mail attachment) using the sender mail adapter?
Hi guys,
Is it possible to process mail attachments using the sender mail adapter? Let's say I have a structured text file (attachment) which needs to be mapped and sent to target system.
Post please any thoughts or experience.
Thanks,
OlianHi Olian,
Have a look at these helpful links -
1. http://www.sdn.sap.com/irj/scn/index?rid=/library/uuid/9e6c7911-0d01-0010-1aa3-8e1bb1551f05&overridelayout=true
2. http://www.riyaz.net/blog/xipi-configuring-the-sender-mail-adapter/
3. http://help.sap.com/saphelp_nw70/helpdata/en/23/c093409c663228e10000000a1550b0/content.htm
Regards,
Sunil Chandra -
Sender File Adapter : File Name Determination
Hi All,
My Scenario :
1) Im my scenario i need only the "FileName" of the File when picked up by the Sender File Adapter.
2) Rest Content of the File need not be in the XML file format.
Now what i did was developed "File Adapter Module " to get the "FileName" when picked up by the Sender File Adapter.
Outcome : When i put the developed module at first and put the file in specified folder allowint the Sender file Adapter to pick up. Now Everything is fine working when one kind of File is placed as per my Content Coversion paramaters.
Actual : My Client would place file of any kind (.jpeg -> Mostly , gif ) i need to get only the file name in the Outbound interface , which i would split it further to my Target Interface.
How could i achieve this , when i took away this content conversion , in sxmb_moni it shows error.I need only the filename in the Outbound not the Content , moreover the hit is i donot know what could be content of my file as it could be different and varing , so i could not set particular content conversion paramters:
Second Question:
Now my outbound XML interface looks as below when i test with a file , with proper content conversion paramerters:
<?xml version="1.0" encoding="UTF-8" ?>
- <MT_DMS_FINAL>
- <Record>
- <Row>
<FirstName>2323_eer_rtr</FirstName>
</Row>
</Record>
<FileName>d:\mdmtest\srinivaS\padusrini.txt</FileName>
</MT_DMS_FINAL>
Well i have designed in my MI only FirstName , how to capture this element "FileName" which i can use it in mapping , if i have to write any UDF to capture it ,please guide me.
thx in advance for u r help
with regards
SriniHi Guys ,
Can i use File Content Conversion for .pdf document , my pdf doc content is not known, means it"s a complete info doc.I may get .jpeg any picture or drawing.
I thought i can use below file content conversion paramters:
Document Name : MT_DMS_FINAL
RecordSet Name : Record
RecordSet Structure : Row,*
Row.fieldNames - FirstName
Row.fieldSeparator - ;
Row.processFieldNames - fromConfiguration
Row.additionalLastFields - ignore
Row.missingLastfields - ignore
Now i put a pdf doc of unknown content , and my assumption was some set of charater would be dumped in XML and rest would be ingonered which is least bothered part in my scenario , unless i get the filename from runtime ot Adapter module developed
But in RWB CC monitoring i see below error :Error: org.xml.sax.SAXParseException: Illegal XML character: .
Any views on this , can any one help me out with the above requirment. Hope u guys got wat am trying to put out here
thx in advance for u r help
with regards
Srini -
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. -
Can we enhance the Sender SOAP Adapter with our own modules?
Hi All,
Can we enhance the Sender SOAP Adapter with our own modules on the Module Tab Page in the Module Processor?
I believe the answer is no. However, whatever may be the answer, I would like to know that is there any specific reason for that.
Please help me in this regard.
Thanks,
Yogi.Hi,
I think, we are mentioning the URL of the adapter channel directly in the configuration. SO there is no place we can customize this flow..just a thought
Because in the file adapter etc, After Adapter Engine picks up the data and before it goes into integration engine module is processed..
http://help.sap.com/saphelp_nw2004s/helpdata/en/fc/5ad93f130f9215e10000000a155106/content.htm
https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/f013e82c-e56e-2910-c3ae-c602a67b918e
Rgds,
Moorthy -
Does the sender SOAP adapter support multiple operations per interface
Hi guys,
does the sender SOAP adapter support multiple operations per interface? (interface type of 7.1)?
Thanks,
Andrzejtheoretically Yes.
Do have a look into this when you get time
/people/shabarish.vijayakumar/blog/2010/09/08/service-interface-and-multiple-operations--is-it-just-an-hype -
How to catch the sender SOAP adapter http response?
Hi eXperts,
I've a sender soap adapter opened to customer as webservice. When customers call this webservice, data is coming into XI and works fine. But the customer is complaining that the expected HTTP 200 response is not sent back to the calling SOAP client.
So my question is: Is there a way to catch the http 200 response from sender adapter, or at least get to know if the sender adapter has sent the response?
Thanks in advance.
Regards
LuisHi,
If I understood it correcly... Sender is a Async SOAP call and the sender system is expcting a status back of HTTP 200. Are you sure you had set the quality of effort to Exactly Once? If not please try setting it.
You can also go to Adapter monitoring or Communication channel monitoring in the Runtime workbench and see if the Sender SOAP adapter is fine.
http://help.sap.com/saphelp_nw04/helpdata/en/5e/164442c1a1c353e10000000a1550b0/content.htm
Thanks,
Prakash -
File adapter modules : Access to file data before content conversion
I have a file sender channel for which content conversion in applied. The incoming file has data in comma separated values format.
e.g.
102366,Amol Joshi,DEPT1
107752,XYZ PQR,DEPT2
I want to access the the actual data in the file before content conversion takes place. Is it possible to access this data inside the adaper module? I tried creating an adapter module and put it before CallSAPAdapter,it still gets the XML after content conversion as the input data to the module.
Any pointers?Hi Amol,
I dont know if it is the right approach.
But if u r not able to meet ur requirement u can do one work around.
Use Message Transformation Bean to convert it once again in to CSV (flat file structure) and then proceed with ur module.
There should be a better way than this.
Hope we could find a better solution in the forum.
Regards,
Sudharshan -
File adapter, File encoding national characters
Hi,
I have a problem with national characters (ÅÄÖ) when sending (receiver adapter) files with the fileadapter.
When i specify Transfere mode = Binary and File Type = Binary everything works fine but when i use Transfere mode =+ Text+ the national characters gets converted to "?". I have tried to set File Type = text and tryed File Encoding with UTF-8 and ISO-8859-1 without success.
Please help!
Regards
ClaesHi,
Check this out: <a href="https://www.sdn.sap.comhttp://www.sdn.sap.comhttp://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/502991a2-45d9-2910-d99f-8aba5d79fb42">How To Work with Character Encodings in Process Integration</a>
Regards,
Jakub -
Sender Mail Adapter - forcing content as an attachement
Hi all,
We are using the Sender Mail Adapter to pull emails from the inboxes of some users of an exchange server. We use the Mail Package option.
We have noticed that the content of the emails are by-default added as attachments when there are no real attachments to the emails. However the content is not added as an attachment when one or more attachments are present in these emails.
Is there a way of forcing the Sender Mail Adapter to always add the content as an attachment and keeping the other attachments as well? and of course maintain the Mail Package message type as the main payload...?
Many thanks,
AldoHi Stefan,
Thanks for your reply. I am glad to hear that I am wrong again )
In your opinion is it possible to force the Outlook Exchange server to add the content attachment every time? I mean by doing some configuration on it...?
The reason why we would like to do this is because when - in the content tag of a Mail Package message - we have MIME message parts that are of content-type text/html we are having problems in decoding the html back to a readable format.
To do this we use the apache QuotedPrintableCodec Java class.
This works fine when the content type of the message is just text/plain but we get an exception when we try with text/html.
The exception we get is:
org.apache.commons.codec.DecoderException: Invalid URL encoding: not a valid digit (radix 16): 13
I don't know if this is because of the two character sets we have in the payload (utf-8 and iso-8859-1) or if it is for other reasons...
If you could help me figure out how to forward any HTML email to another system in a readable format it would be great.
Thanks for your support,
Aldo -
Dear SAP Gurus
Interface flow:
File --> File and RFC.
We have a requirment where PI needs to check the file existency in archive folder and if there is a file already exists with same name we need to rename that file and archive the current file as is...
Note* Customer don't want to add time stamp!!!!
For ex today first message processed with file name "UBMO_delta20140626.xml" and archived as is- UBMO_delta20140626.xml
and customer sends a second file on the same day with same name(UBMO_delta20140626.xml) in this case before archiving PI needs to check whether there is a file exists already in archive folder or not if there is, then it should rename the same like(UBMO_delta20140626_1.xml) and proceed with current message processing and archive the same name(UBMO_delta20140626.xml).
Many Thanks in advance...
NageshHi Nagesh,
I think you can use the feature of run operating system command before message processing. you can refer the below wiki for information.
SAP XI File Adapter OS Command Line Feature - Process Integration - SCN Wiki
regards,
Harish
Maybe you are looking for
-
How to make project in 16:9 ratio?
Hello guys, I apologize for this very silly question. But how do I make my project appear as 16:9? I did open new project and set presets as HDV 1080i. But the project (main window) is still appearing as 4:3. What am I missing?
-
I am new to Web Dynpro. I am trying to create a simple Web dynpro following an SAP tutorial. The directions are as follows: step 1)In this step you first create a new component. To do this, call the Object Navigator and choose Web-Dynpro-Comp./Intf i
-
Copying Graphs and Pie Charts generated in Analysis View to Email item using Excel VBA Macro Code
Hi I am currently working on an exce VBA macro code that would help me take snapshots of the Graphs and Pie charts generated in QC for a particular application and copy the same to an email item using excel VBA macro code. I was able to write the cod
-
My macbook pro is very slow after instal OSX
My macbook pro is very slow after instal OSX
-
PostScript feeding to the WRONG printer tray
I've got a real quandry here. I have a system that runs mainly character mode reports, but a few bitmaps. They used to print to the same tray as the character mode reports. I use a perl script to print all reports to a postscript file, and then lpr t