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
Similar Messages
-
Removing blank rows in File Content Conversion
The following is the snippet of XML in a file produced by the File Receiver Adapter using FCC. The mapping is fairly complex and results in blanks rows being outputed. I need to remove this but I don't want to change my mapping. I've tried using .fieldContentFormatting "trim" to no avail.
Once again, can anyone help me?
<Prices COLUMNS="IndexName, Date, IndexPrice">
Price_OU_gas,2007-05-01,23
Price_OU_gas,2007-05-01,65
Price_OU_gas,2007-05-01,66
Price_OU_gas,2007-05-01,12
Price_OU_gas,2007-05-01,56
</ GasPrices>Crowe,
In the mapping only specify for the root node a Boolean funciton like:
If --> Source not equals to space then (put your mapping logic) ---> createif --> Target.
---Satish -
Encoding problem after File Content Conversion
Hi SAP gurus!
we're about exporting debitor data via PI into CSV files. Therefore we use a mapping to an intermediate structure. In the receiver file adapter a file content conversion is done into the target CSV format.
We have a lot of data with eastern europe characters. Right after the mapping, everything is fine. All characters are processed correctly. After the file content conversion, the files written on the target system contain "?" instead of the special characters.
Does anybody have any hint to fix this problem? We already tried to change the "file.encoding" parameter, but hasn't helped.
Thanks in advance for your support!
Cheers,
MatthiasHello Satish,
thanks for your reply.
First, I have to explain, that the sender side isn't done by file adapter but IDoc adapter. So I cannot change the encoding on sender side.
Both on IDoc and file side, the data is ok. Only when inserting the file content converion, the files become corrupted.
Without using the FCC, tjhe target files are stored as UTF-8. When using FCC the files are stored as ANSI. (I tested this by opening the files in notepad and performing "Save As")
Do you have further ideas?
Cheers,
Matthias -
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 -
New Line with File Content Conversion
Hi there
I have a interesting question, I need to add a new line in the middle of a flat file. I read an idoc and using content conversion I convert it to a flat file. Is there any way I can divide the idoc into 2 parts separated by a new line?
Thanx,
Jan> I have a interesting question, I need to add a new line in the middle of a flat file. I read an idoc and using content conversion I convert it to a flat file. Is there any way I can divide the idoc into 2 parts separated by a new line?
Hi,
In my opinion using the regular FCC method I guess it will be not possible to create a new line in the middle of flat file. You can take the help of java mapping as described in bleow mentioned blogs to convert it into flat file. I am not sure but you can try with these options...
"JAVA MAPPING", an alternate way of reading a CSV file
Java Mapping to handle flat files in SAP XI
Regards,
Sarvesh -
Splitting to new line in file content conversion in File Receiver adapter
Hi,
I have a requirement where I have to split the Header and Line item in separate lines. If the Target structure as follows:
RecordSet>Record>Header-->LineItem.
If I do Header and LineItem at the same level, I do not have a problem. If I do that I could not able to map from Idoc correctly. Therefore, I have to do LinteItem tag within Header.
Please thru some Ideas , how we can this.
Thanks
VenkatHi,
In FCC use two time Record.endSeparators
Like
Record.endSeparator - 'nl'
Record.endSeparator - 'nl'
I think this will solve yr problem.
Regards
Vikas -
New line in file content conversion....
hi,
i have a scenario where i need to seperate two records with 2 lines
example
<record1> name1 name2 name 3
<record2> name11 name22 name 33
where each records seperated by 2 lines
i have tried using a endSeparator with 'nl' two times but it was no help
kindly helkp me on this
with regards
N pradeepHi,
In FCC use two time Record.endSeparators
Like
Record.endSeparator - 'nl'
Record.endSeparator - 'nl'
I think this will solve yr problem.
Regards
Vikas -
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 -
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 Receiver Adapter(File Content Conversion)
Hi All,
If i open my file using notepad after File Content Conversion i am seeing a BOX kind of Symbol after Every Row ..
but the same file if i open using word i am not seening that BOX ,,and the file is perfect ..can any plz tell what is the reason ... ?
i gave<b> filedfixedlenght & Endsaparator</b> only
is that i need to add any thing in the File Content Conversion parameters...
thanks
shakifHi Mohammad,
If I am not wrong "Box kind of symbol" would be "Symbol" for end of the line(EOL).
In win-word if you click on "Show/Hide tab" You will see same symbols.
Does it makes any problem while processing file?
Let us know more details.
Nilesh -
Need help in file content conversion complex structure
Hi Guys ,
Iam new to this file content conversion , Please let me know whether below requirement is possible .if yes than how ?
Inbound XML file from Proxy
<Data>
<keyfield1>0011</keyfield1>
<keyfield2>0012</keyfield2>
<Keyfield3>0013</Keyfield3>
<field1>Test1</field1>
<field2>testfield1</field2>
<field3>0001</field3>
<Data>
<keyfield1>0021</keyfield1>
<keyfield2>0022</keyfield2>
<Keyfield3>0023</Keyfield3>
<field1>Test2</field1>
<field2>testfield2</field2>
<field3>0002</field3>
output pgp flat file .
pgp file format should be as below after file content conversion
0011|0012|0013|Test1||||||
0011|0012|0013|Testfield1||||||
0011|0012|0013|0001||||||
0021|0022|0023|Test2||||||
0011|0012|0013|Testfield2||||||
0011|0012|0013|0002||||||
thanks a lot .
Regards
PrabhuHi.
Try this.
First you need to use a message mapping and create a target structure to convert a similar output structure that do you want. like this
<Target>
-- Field1
-- Field2
-- Field3
-- Field4
-- Field5
-- Field6
-- Field7
-- Field8
-- Field9
</Target>.
Then map
keyfield1-> Field 1 ,keyfield2-> Field 2 , keyfield 3---> Field 3
map field1-> field4 .. for the others fields duplicate the Target node (right click) and map map field2-> field5 ..etc.
For the field 5 until field 9 map with constant ("'')
Then in you receiver comunication channel put simple parameters.
Target.fieldSeparator = |
Target.endSeparator = 'nl'
Regards. -
Query regarding file content conversion using file adapter
Hi All
I have a question regarding file content conversion in file adapter.
I have a file coming in the following format.
AA,111,222,333
BB,444,555,666
CC,777,888,999
My incoming message structure has a hierarchy. The CC record is a structure part of BB record. BB record is a structure part of AA record. It is like this:
AA,111,222,333
<<BB,444,555,666>>
<<<<CC,777,888,999>>>>
After file content conversion, in the resulted xml, i am getting a flat hierarchy instead of nested hierarchy.
Is it possible to get a nested hierarchy as a result of file content conversion?
Please let me know
Thanks
ChandraHi Udo
According to your suggestion, I am trying to use mapping.
I am getting a flat file and i am reading it.
This is my source structure:
AA,11,22,33
BB,44,55,66
CC,77,88,99
This is my required targer structure:
AA,11,22,33
<<BB,44,55,66>>
<<<<CC,77,88,99>>>>
To explain this, BB record can have multiple records of CC records.
AA records can have multiple records of BB record.
I am using removecontext node function.
CC (Source) (removecontext)-> CC (target structure)
But here, when i rightclick on source CC field in the mapping editor, i cannot see any other context except root node. So, how can i proceed here??
Many Thanks
Chandra -
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. -
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...
Maybe you are looking for
-
IM, voice, video, NOT AIM
I would like to video message using iSight, with sound, but not use AIM with a person who has a PC. Is that possible? Yahoo will allow video, and IM, but no sound.
-
Is it possible to sort search results
Is there a way to setup the order of the search results during the project build process? Currently in my manual when a user searches for an item, the results come up in alpha order. If possible I would prefer to display them in order of relevance. A
-
Sending and recieving messages.
Hi, I am join a new company and ans working with the jms now. "QueueConnection" and "Queue" (or Destination) is ready there. I need to set up one testing program which can send and receive the messages please provide the guidence. Thanks in Advance.
-
I have created a report that I am trying to setup QBE functionality. My problem is I want to conditionally add items to the where clause based on if they are NULL or not. If the user has left the field/select list empty I would like not include it in
-
Photoshop Manages Color Epson R1900
My epson R1900 printer will not print the color green- all inks are full