Whitespace removed in Content Conversion
Hey!
After content converting a flat file and running it through an xslt mapping, the java mapping need to find substrings within some fields.
It turns out the fields are suppressed, meaning the whitespace before and after values are missing.
Can this be fixed within the CC in the file adapter? I need these whitespaces to be there as I am accessing different values within the long string.
regards Ole
Hi,
I too have a similar issue, i tried viewing the input in notepad but even in that spaces are missed.
Could you suggest me on this.
Regards
Archanaa
Similar Messages
-
File Content Conversion Removes Leading Blank/Space
I'm having a problem where file content conversion is trimming leading blanks/space/whitespace from fields when reading in the inbound file. I've seen where people have posted that you need to use fieldContentFormatting to prevent content conversion from stripping the leading/trailing whitespace. I added that parameter to my list (see below example) but it still appears to be trimming the leading whitespace. Look forward to hearing your thoughts. Here are the details:
I'm using fixed length file content conversion for Sender File Adapter (SP15). I have the following parameters set:
Document Name = MaterialData
Recordset name = item
Recordset Structure = MaterialLine, 1
I have:
MaterialLine.fieldNames = matno_external, mat_description
MaterialLine.fieldFixedLengths = 40, 40
MaterialLine.fieldContentFormatting = nothing, nothing
The following is the input file (notice spaces prior to second occurrence of material numbers)
ZED00000001 AIMS LIGHT A
ZED00000001 AIMS LIGHT B
ZED00000002 AIMS SWITCH A
ZED00000002 AIMS SWITCH B
ZED00000003 AIMS SEMICONDUCTOR A
ZED00000003 AIMS SEMICONDUCTOR B
The following is the source XML after file content conversion from SXMB_MONI (note spaces no longer exist in matno_external tag).
<?xml version="1.0" encoding="utf-8" ?>
- <ns:MaterialData xmlns:ns="http://xxxxxxx.com/yyy/test">
- <item>
- <MaterialLine>
<matno_external>ZED00000001</matno_external>
<mat_description>AIMS LIGHT A</mat_description>
</MaterialLine>
</item>
- <item>
- <MaterialLine>
<matno_external>ZED00000001</matno_external>
<create_date>10/09/06</create_date>
<mat_description>AIMS LIGHT B</mat_description>
</MaterialLine>
</item>
- <item>
- <MaterialLine>
<matno_external>ZED00000002</matno_external>
<mat_description>AIMS SWITCH A</mat_description>
</MaterialLine>
</item>
- <item>
- <MaterialLine>
<matno_external>ZED00000002</matno_external>
<mat_description>AIMS SWITCH B</mat_description>
</MaterialLine>
</item>
- <item>
- <MaterialLine>
<matno_external>ZED00000003</matno_external>
<mat_description>AIMS SEMICONDUCTOR A</mat_description>
</MaterialLine>
</item>
- <item>
- <MaterialLine>
<matno_external>ZED00000003</matno_external>
<mat_description>AIMS SEMICONDUCTOR B</mat_description>
</MaterialLine>
</item>
</ns:MaterialData>Thanks all for your attempts but I figured it out and wasn't this the biggest case of irony.
Here I was trying to prevent leading spaces from being trimmed in the loading of my file and my problem was that when I typed:
MaterialLine.fieldContentFormatting
I actually left a "blank" at the end of the "g" in Formatting. Apparently XI didn't like that and neither gave me a runtime or compile error. Anyway I found this and though I'd share in case anyone else encounters it. I removed the blank and all is working now. -
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
SrinivasSrinivas,
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 -
File Content Conversion--- Removing Quotations from csv file
I have a csv file in the folowing format:
field1,field2,field3,field4
"111","222","333","444"
"aaa","bbb","ccc","ddd"
Suppose the header name is row in IR.
While configuring the sender file adapter in XI, i have given following parameters under file content conversion.
row.fieldNames=field1,field2,field3,field4
row.fieldSeparator=","
row.processFieldNames=fromConfiguration
row.beginSeparator="
After picking up the XML file XI processes the data so that we have out put as
row
field1 111
field2 222
field3 333
field4 444"
row
row
field1 aaa
field2 bbb
field3 ccc
field4 ddd"
row
My Problem is what parameter should I add in ID to remove this last quote say 444" and ddd" from the XML message ????
I tried using
row.endSeparator=" but it is still giving the same output.
Can anyone help ????????????????????????Hi,
Try this FCC instead
row.fieldNames=field1,field2,field3,field4
row.fieldSeparator=,
row.processFieldNames=fromConfiguration
row.enclosureSign=u201C
row.enclosureSignEsc=u201Cu201C
row.endSeparator='nl'
http://help.sap.com/saphelp_NW04/helpdata/en/e3/94007075cae04f930cc4c034e411e1/frameset.htm
If you specify xml.enclosureSign=u201C and xml.enclosureSignEsc=u201Cu201C, text enclosed in quotation marks is transferred unchanged and the quotation marks are removed.
Thanks
SaNv... -
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> -
Content Conversion - How to Remove Trailer
Hi there.
I am having difficulty identifying the correct parameters to enable me to remove the trailer of a text file. The file will have a random number of data rows and there is no "key" field to identify these rows. The Trailer rows are however are fixed values. Sample file below:
DATA==> FNX7 Comdty|0|12|013
DATA==> FNZ7 Comdty|0|12|
TRAILER1==> END-OF-DATA
TRAILER2==> TIMEFINISHED
TRAILER3==> END-OF-FILE
I would appreciate any help on how to configure the Content Conversion Parameters to ignore the trailer. I have looked online and have seen many scenarios, but all involve a level of "Key Identifying" which I cannot do for the Data Fields. Is there any parameters to allow me to ignore the trailer fields??
Regards.
Mick.Hi-
See this help
http://help.sap.com/saphelp_nw04/helpdata/en/d2/bab440c97f3716e10000000a155106/content.htm
Also check these links
File adapter content conversion
Receiver File content conversion -
RCVR File Content Conversion - Remove empty Recordsets
Hello everyone,
Here's my scenario: IDOC > XI > TXT (File Content Conversion)
Here's how my output XML currently looks like:
<?xml version="1.0" encoding="UTF-8"?>
<ns0:D001FILE_MT xmlns:ns0="http://www.pharmaindustries.com">
<Recordset/>
<Recordset>
<MATLCODE>00155581</MATLCODE>
<MATLNAME>ALCOHOL REFINED 96% V/V (BALAYAN)</MATLNAME>
</Recordset>
<Recordset>
<MATLCODE>00155581</MATLCODE>
<MATLNAME>ALCOHOL REFINED 96% V/V (BALAYAN)</MATLNAME>
</Recordset>
<Recordset/>
<Recordset>
<MATLCODE>20388853</MATLCODE>
<MATLNAME>POLYSORBATE 60 SD (TWEEN 60 SD)</MATLNAME>
</Recordset>
</ns0:D001FILE_MT>
Currently, the conversion settings in the receiver file adapter results into this:
BLANK
00155581 ALCOHOL REFINED 96% V/V (BALAYAN)
00155581 ALCOHOL REFINED 96% V/V (BALAYAN)
BLANK
20388853 POLYSORBATE 60 SD (TWEEN 60 SD)
I want to get remove the BLANK LINES from the text file so that it now resembles this:
00155581 ALCOHOL REFINED 96% V/V (BALAYAN)
00155581 ALCOHOL REFINED 96% V/V (BALAYAN)
20388853 POLYSORBATE 60 SD (TWEEN 60 SD)
Here are the conmmand parameters already existing in the "Content Conversion Parameters":
Recordset.fieldNames
Recordset.fieldFixedLengths
Recordset.endSeparator
Would anyone know which command I should add in this section so that empty "Recordsets" are removed from the text file?
Thanks in advance!
GlennHi,
as per my understanding, u have teo record sets
i.e Recordset(bold one which has no fileds)
Recordet(which has two fileds)
if you use Recordset.field Separator-- 'nl'
nothing but ignoring the first record set
for second record set(which is not bold)
provide FCC parameters which i have provided previously.
still u r facing problem, try with
ignore recordset name - true
Recordset.fieldContentFormatting - ignore
note: here you have two record set i.e<Recordset>(blod)
<Recordset>(not bold).
warm regards
mahesh. -
Remove blank line after File Content Conversion
I have a File>Conversion on PI7.0 (SP10).
It seems to add a blank line. The XML is:
<?xml version="1.0" encoding="UTF-8" ?>
- <ns0:EPIWCountFile xmlns:ns0="urn:com.somewhere.overthere.nothere">
<Personal_Area>LU</Personal_Area>
- <detail>
<recordCount>17</recordCount>
</detail>
</ns0:EPIWCountFile>
The conversion is done:
recordset Structure=detail,
name=detail.fieldseparator ,
The output file is
17
Hopefully you can see the blank line before the number!???
I have changed the contexts while processing, and played with other options, but it always adds a blank line at the begin.
All this file is a count of the number of records processed. (The personal_area is for a variable name for file/folder creation)
How can I remove the blank line, as the target system fails due to this anomaly?If you are in a development environment, try this
Make your target structure
<?xml version="1.0" encoding="UTF-8" ?>
- <ns0:EPIWCountFile xmlns:ns0="urn:com.somewhere.overthere.nothere">
- <detail>
<b><Personal_Area>LU</Personal_Area></b>
<recordCount>17</recordCount>
</detail>
</ns0:EPIWCountFile>
Content conversion parameter
detail.fieldFixedLengths 0,2
detail.fixedLengthTooShortHandling Cut
P.S: If you need <Pesonal_Area> tag only for File/Folder Name, then why dont you use Adapter specific Identifiers to achieve the same.
Regards,
Jai Shankar -
Removing concurrent values in content conversion
Hi there
I have a file that looks like:
"Value1","Value2",Value3","Value4","Value5"
If I pick up this flat file I have to remove the " " arround the values. Is there a way to do this with content conversion? And then If I create the file again I have to put the " " back arround the values.
Thanks,
Janthere is nothing standard as of now in the content conversion parameters.
the options you have is;
1. write an udf and use it in every field to remove/add the "
2. write a simple java mapping that will remove all "
3. similar logic but implement it as a module -
Remove Header Node in File Content Conversion
Hi Guys,
In our scenario receiver payload is
<?xml version="1.0" encoding="UTF-8"?>
<ns1:MarketInventoryResponse xmlns:ns1="PRINCIPALS/MarketInventory">
<Header>
<CurrentDate>200809</CurrentDate>
</Header>
<MarketInventory>
<Local_ProductCode>121</Local_ProductCode>
<WH_QTY>20</WH_QTY>
<WH_Cost>3000</WH_Cost>
<Store_QTY>40</Store_QTY>
<Store_Cost>5000</Store_Cost>
</MarketInventory>
</ns1:MarketInventoryResponse>
We are using File content conversion method. Now we got the output is
200809
121#20#3000#40#5000
But We need below mentioned format.
121#20#3000#40#5000
we don't need CurrentDate which is in Header node. So, how to ignore Header node in FCC method. Please any one help me.
Note : Now we using following parameters in FCC
Recordset Structure : MarketInventory
MarketInventory.addHeaderLine : 0
MarketInventory.fieldSeparator : #
MarketInventory.endSeparator : 'nl'
Thanks & Regards
VijayHi Vijaya,
You have two options:
1.- Sãnthosh Kûmãr V Solution:
Recordset Structure : Header,MarketInventory
Header.fieldFixedLengths = 0
Header.fixedLengthTooShortHandling = Cut
Header.endSeparator = '0'
2.- Use Adapter-Specific Message Attributes in your File adapter.
In the last one you would have to set the name of your file in FileName atributte.
Carlos -
Content Conversion trims values
Hi all - I'm using content conversion to bring in fixed-width fields from a flat MQ message - but my values are getting front & back spaces trimmed. I have set up the length parameter on the attributes of all my data types, as well as "preserve" for the whitespace facet. Any ideas? I need to keep the spaces, as the values should be stored in SAP EXACTLY the way the customer sends them to us.
Try out:
xml.fieldContentFormatting=trim|nothing
If you specify trim (the default setting), all blanks that proceed and follow a found value are removed.
If you specify nothing, the value remains unchanged.
A list of all parameters of the content conversion module, you find in the online documentation for Plain J2SE Adapter Engine -> Configuring Sender/Receiver File Adapter.
Regards
Stefan -
File Sender Content Conversion: Help needed
Hello Experts,
i need help with file sender content conversion:
i have a file which looks like this:
12329460 24.01.09/07:01 167 Y010122851 136086 43300007 E70115 1L2_96_1
12329660 25.01.09/07:02 157 Y010122851 136086 43390007 E711J5 1L2_96_1
as you can see 8 fields, separated with whitespaces
and i want and xml file which looks like this:
<DT_DATA_FILESENDER>
<Recordset>
<Data>
<field1>12329460</field1>
<field2>24.01.09/07:01</field2>
<field3>167</field3>
<field4>Y010122851</field4>
<field5>136086</field5>
<field6>43300007</field6>
<field7>E70115</field7>
<field8>1L2_96_1</field8
</Data>
<Data>
<field1>12329660</field1>
<field2>25.01.09/07:02</field2>
<field3>157</field3>
<field4>Y010122851</field4>
<field5>136086</field5>
<field6>43390007</field6>
<field7>E711J5</field7>
<field8>1L2_96_1</field8
</Data>
</Recordset>
Would you please let me know how the datatype has to look like?
And especially how the FCC has to be configured for this scenario?
Thanks in advance,
Chris> With fixed lengths i get it working,
>
> but with de fieldseparator 0X09 it does not work,
> would you please tell me the complete FCC config not only the fieldSeparation line?
Well Christian,
There is one thing, eithere you can use fieldSeparator or fieldFixedLengths you can not use both together. So in your case do not use fieldSeparator.
The complete FCC is almost same as given in the blog in my previous reply. See the final output in that blog and create your data type accordingly. e.g.
Recordset
------Item 0...unbound
--------Field1 0..1
--------Field2 0..1
--------Field3 0..1
--------Field8 0..1
Regards,
Sarvesh -
Content Conversion in receiver channel
Hi all,
I have a proxy to FTP scenario with no mapping involved.Over proxy communication PI is receiving the data, I am creating the CSV file using content conversion in receiver channel and placing the file at FTP.
The file name is coming in one of the field of the input xml,I am using variable substitution and setting the file name from that particular field value.But as I don't want that node and file name element in my output file content, please guide me what parameters can I set in my content conversion to remove the FileNode from o/p csv file.
The sample input xml is
<MT>
<Record>
<Field1>1</Filed1>
<Field2>2</Filed2>
</Record>
<Record>
<Field1>3</Filed1>
<Field2>4</Filed2>
</Record>
<FileNode>
<FileName>InutFile</FileName>
</FileNode>
</MT>
I want output xml to be like
1,2
3,4
I have followed this blog /people/sravya.talanki2/blog/2005/08/11/solution-to-the-problem-encountered-using-variable-substitution-with-xi-sp12 to cut the FileNode, but it gives an error in cc parameters.
In my actual i/p payload,the Record is 0..unbounded and there are 50 sub elements inside Record element.
Please provide your inputs.
Thanks,
RuchiHi Ruchi,
Change your structure like this.
MT>
<Record>
<Field1>1</Filed1>
<Field2>2</Filed2>
</Record>
<Record>
<Field1>3</Filed1>
<Field2>4</Filed2>
</Record>
<FileNode>
<FileName>InutFile</FileName>
</FileNode>
</MT>
Dont put the filenode under Record.
Also Add the below parameters.
FileNode.fieldSeparator '0'
FileNode.endSeparator '0'
FileNode.fieldFixedLengths 0
FileNode.fixedLengthTooShortHandling Cut
FileNode.fieldNames FileName
Now use the same parameter mentioned in the blog .Your problem will be resolved. -
Subnodes and content conversion in FTP-Adapter
Hello experts,
the scenaria is IDOC -> XI -> FTP and content conversion is used.
The structure of the IDOC is like:
<head></head>
<pos>
<subnode></subnode>
</pos>
<pos>
<subnode></subnode>
</pos>
There can be 1 ore more positions.
We mapped this to a XML-structure according to help.sap.com
http://help.sap.com/saphelp_nw04/helpdata/en/d2/bab440c97f3716e10000000a155106/frameset.htm
As we are not allowed to use subnodes all segments have to be on one level.
How can I map to a structure (with 1 OR MORE positions) like
<head></head>
<pos></pos>
<subnode></subnode>
<pos></pos>
<subnode></subnode>
At the moment we are only able to map to:
<head></head>
<pos></pos>
<pos></pos>
<subnode></subnode>
<subnode></subnode>
In the datatype I can't specify that a position always is followed by a subnode ... i only can use remove context in mapping and put all subnodes beneath the positions. Is there any possibility in graphical mapping to change this?
Thanks and regards,
DavidOk, what can I do, to describe a data typs with variable amount of pos' FOLLOWED by subnodes?
Or is it possible to create an item line with pos and subnode and remove this line later (move everything to first level).
<item>
<pos>
<subnode>
</item>
<item>
<pos>
<subnode>
</item>
<item>
<pos>
<subnode>
</item>
MAP TO:
<pos>
<subnode>
<pos>
<subnode>
<pos>
<subnode>
I can't create a data type like this...
EDIT:
Remember, there can be documents with 1 or many positions... and the fieldname always is the same.... the datatype definition doesn't acceppt duplicate fieldnames and fields that are not in a defined sequence.
Edited by: David Claes on Jul 10, 2008 2:09 PM
Edited by: David Claes on Jul 10, 2008 2:11 PM -
Regarding content conversion parameter
Hi
I am doing content conversion in sender file adapter.I want to remove " " in target file.
I used row.enclosureSignEsc ""
but its not working.
can any one tell me how to use enclosure sign parameter.
Source Flat file looks like:
"A00",417,"SC9",20050101,100617,3229
"B01","EA",20041231,39.4,"ACT","F","D"
"B01","EA",20041231,38.7,"ACT","F","W"
"B01","EA",20050101,39.4,"TOD","F","D"
"B01","EM",20041231,39.3,"ACT","F","D"
"B01","EM",20041231,38.7,"ACT","F","W"
"Z99",50
In the target i want like this:
A00,417,SC9,20050101,100617,3229
B01,EA,20041231,39.4,ACT,F,D
B01,EA,20041231,38.7,ACT,F,W
B01,EA,20050101,39.4,TOD,F,D
B01,EM,20041231,39.3,ACT,F,D
B01,EM,20041231,38.7,ACT,F,W
Z99,50
Thanks&Regards
venkat.>
venky adireddy wrote:
> Hi
> I am doing content conversion in sender file adapter.I want to remove " " in target file.
> I used row.enclosureSignEsc ""
> but its not working.
> can any one tell me how to use enclosure sign parameter.
>
> Source Flat file looks like:
>
> "A00",417,"SC9",20050101,100617,3229
> "B01","EA",20041231,39.4,"ACT","F","D"
> "B01","EA",20041231,38.7,"ACT","F","W"
> "B01","EA",20050101,39.4,"TOD","F","D"
> "B01","EM",20041231,39.3,"ACT","F","D"
> "B01","EM",20041231,38.7,"ACT","F","W"
> "Z99",50
>
> In the target i want like this:
>
> A00,417,SC9,20050101,100617,3229
> B01,EA,20041231,39.4,ACT,F,D
> B01,EA,20041231,38.7,ACT,F,W
> B01,EA,20050101,39.4,TOD,F,D
> B01,EM,20041231,39.3,ACT,F,D
> B01,EM,20041231,38.7,ACT,F,W
> Z99,50
>
>
>
> Thanks&Regards
> venkat.
THERE
there is no parameter to achieve what you want in FCC.
as mentioned earlier you will have to use a function to remove the "
you dont have to create a UDF you can use the standard text function available in XI - replaceString
Maybe you are looking for
-
HP OfficeJet 7110 All-in-One USB'd to PC Need to know how to get mac to see
Hello all. I am a new mac user and this will become evident soon I am sure. I have a new macbook with the OS X 10.4.10 version. I have a 2.16 duo with 2 gb ram and 120gb hdd. The printer in question is a HP Officejet 7110 all-in-one. The PC it is con
-
[CS3 JS] event crashes InDesign
Scripting ladies and gentlemen, I'm working on this event script that searches for linked PDF files and lets the user copy/relink them. Using the afterOpen eventListener however crashes InDesign no matter what I do. This is also the case with beforeC
-
How do i create email folders on my i phone 4s
how do i create email folders on my i phone 4s
-
I am using a toolbar just like Form 5 Default toolbar. Toolbar is in seperate control block. My problem is I can enter query, but when I try to execute it, it doesn't work. I tried changing block before issuing execute query command. but still doesn'
-
Does Time Machine Compress My Data?
Can I use a 160Gb external drive to back up more than 160Gb of data on my computer? Does Time Machine compress anything, or would I have to decide what to back up and what not to?