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!
Glenn
Hi,
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.
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. -
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... -
File content conversion scenario-empty file
Hi all,
I am doing file content conversion for my sender flat file. And I want to generate XML file in my receiver location.When I check with test tab in my message map in IR , no structure gets generated in RESULT.Overalls cenario is working fine and message is processed successfully but empty file is getting generated in target directory.When I check the payload in message content in RWB communication channel monitoring,it's picking data correctly from the file.I am not getting what might have gone wrong with my message mapping in IR. It's not showing any syntax error.Even it's not generating target message structure in Results window of test Messsage mapping.Could you suggest what mistake might be there in message mapping.Hi all,
I am getting this message in message monitor(SXMB_MONI).
com.sap.aii.utilxi.misc.api.BaseRuntimeException
thrown during application mapping
com/sap/xi/tf/_MM_Flat_content_conv_:
RuntimeException in Message-Mapping transformatio~
I am able to see the output structure in test window of message mapping in IR and communication channel monitoring is also showing successful message.
fcc parameters used are:
Header.fieldNames KEY,EMPID,NAME,COMPANY,PHONE
Header.fieldFixedLengths 1,4,20,15,12
Header.processConfiguration FromConfiguratiion
Header.keyFieldValue H
Detail.fieldNames KEY,COMPANY,LOCATION
Detail.fieldFixedLengths 1,15,10
Detail.processConfiguration FromConfiguratiion
Detail.keyFieldValue D
Please suggest the mistake in mapping
Edited by: Jaya on Mar 3, 2010 12:45 PM
Edited by: Jaya on Mar 3, 2010 12:47 PM -
File Content Conversion and Empty file issue
Hello,
The issue is :
I have configured a file sender adapter with file Content Conversion. I have 2 kinds of records Header and Items.
i have defined the 'Key Field Name' based on the first character of each line of my flat file and the values associated :
Header.keyFieldValue = 1
Item.keyFieldValue = 2
Flat file example :
1;Headerfield1;Headerfield2
2;ItemField1;ItemField1;ItemField1;ItemField1;
2;ItemField1;ItemField1;ItemField1;ItemField1;
2;ItemField1;ItemField1;ItemField1;ItemField1;
and everything works fine !
But now imagine you receive a bad file like this :
xxxxx;ohhohoh;llllll
y;sdfsdfs;zezerz;zerzer
e;zerzerze;zezerzerzer
The result is : IS receive nothing and no alert is generated ?!!!???
What i have seen is that the adapter doesn't find any corresponding value for keyFieldValue so it consider that the flat file is empty and i do nothing, the file is archived and that's all no alert is generated ????
But i want to receive an alert for checking that the processed flat file was not correct !
If anybody has an idea, it will be great !
Regards,
VincentHi Vincent.
Sometimes it really #!@#%%#.. me off when customers excepts that XI will solve their whole organization interfacing problems (and the world hunger as well...:)...
even when it comes to the responsible systems that creates the file(sometimes with bugs and problems even before XI came to the org.).as in every developed application or out of the box one, the application has to take care of its outputs and deal with errors. when it cant deliver what other systems expects her to it has to inform some one...
When it comes to the Adapter frame work XI expects the system in its landscape to be responsible for the data they send (well formed and with the defined structure...IDocs,XML,flat files).
as mentioned in my colleagues previous postings you can take care of data verification during mapping and so..
I belive it is possible to monitor the incoming file before it is parsed to XML (not sure it is the right way to) and maybe we'll get a solution to that in the future (today we can monitor the comm. channel wether its configures well or not,maybe it will be possible in the future to alert when an incoming file is empty)
Regards.
Nimrod -
File Content Conversion: Remove reserved characters from Content
Hi PI Gurus,
we're facing a little problem with FCC in File Receiver Adapter. Sometimes the defined fieldSeparator ("|") comes within the field content.
e.g.
<?xml version="1.0" encoding="UTF-8"?>
<ns0:Positions xmlns:ns0="http://test.com">
<Position>
<Value1>001</Value1>
<Value2>Test|Content</Value2>
</Position>
</ns0:Positions>
So, my first thought was to replace all "|" with a litte java mapping beind the actual mapping.
But, is there any possibility to achieve this via configuration of FCC (something like fieldSeperatorSubstitution)?
Help is as always highly appreciated!
Cheers,
Matthias KralHello Hareenkumar,
yes you're totally right. I ran in several OutOfMemoryError while testing the code above. The errors started with messages over 15 MB.
Here's the code, that is productive now. It replaces all Pipes "|" by Slashes "|" and really works fine and performant.
public void execute(InputStream in, OutputStream out)
throws StreamTransformationException {
try {
int totalCount = 0;
byte[] buf = new byte[40960];
int count = 0;
while (count >= 0) {
count = in.read(buf);
totalCount += count;
if (count > 0) {
for (int i=0; i<count; i++){
if (buf<i>==124){
buf<i> = 47;
out.write(buf, 0, count);
} catch (IOException e) {
throw new StreamTransformationException(e.getMessage());
Thank you all again!!!
Cheers Matthias -
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-. -
File content conversion is not creating the exact strcuture as Datatype
Hi,
We are facing issue .
I have sender DT type
<FIle_DT>
< HeaderDetail>
<Field1>
<Field2>
<Linietemdetails>
<Field1>
<Field2>
</Linietemdetails>
</ HeaderDetail>
</File_DT>
but when I am preocessing the file content conversion - > when its pulling the data from the file this structure become
<FIle_DT>
< HeaderDetail>
<Field1>
<Field2>
</ HeaderDetail>
<Linietemdetails>
<Field1>
<Field2>
</Linietemdetails>
</File_DT>
I want same above one after content conversion. I tired allt he options availble . please help
In file content conversion I give
RecordSet Structure -->HeaderDetail,,LineItemDetail,
HeaderDetail.keyFieldValue H
HeaderDetail.endSeparator 'nl'
HeaderDetail.fieldFixedLengths 1,4,8,25
HeaderDetail.keyFieldInStructure ignore
LineItemDetail.keyFieldValue L
LineItemDetail.endSeparator 'nl'
LineItemDetail.fieldFixedLengths 1,3,1,10,10,24,3,25
LineItemDetail.keyFieldInStructure ignore
LineItemDetail.keepIncompleteFields YES
ignoreRecordsetName true
Please help
regards
RamHi Babu,
Thanks a lot for your input.
Actually My requirement is this its file to Multiple idoc scenarios.
Here I am getting flat file HeaderDetails and LinItemdetails. its having Multiple Headerdetail then Line Item Details, I want to create idoc for each HeaderDetail and all the Next LineItemdetails should go to that IDoc. If we can find some solution then it will also work for me.
For ex.
My source would be
FIle_DT>
< HeaderDetail1>
<Field1>
<Field2>
</ HeaderDetail>
<Linietemdetails11>
<Field1>
<Field2>
</Linietemdetails11>
<Linietemdetails12>
<Field1>
<Field2>
</Linietemdetails12>
< HeaderDetail2>
<Field1>
<Field2>
</ HeaderDetail>
<Linietemdetails21>
<Field1>
<Field2>
</Linietemdetails21>
<Linietemdetails22>
<Field1>
<Field2>
</Linietemdetails22>
< HeaderDetail3>
<Field1>
<Field2>
</ HeaderDetail>
<Linietemdetails31>
<Field1>
<Field2>
</Linietemdetails>
</File_DT>
I want target structure like this .
<Idoc>
<HeaderDetail1>
<LineItemdetail11>
<LineItemdetail12>
<LineItemdetail13>
</Idoc>
<Idoc>
<HeaderDetail2>
<LineItemdetail21>
<LineItemdetail22>
<LineItemdetail23>
</Idoc>
<Idoc>
<HeaderDetail3>
<LineItemdetail31>
</Idoc>
If anyway you can help me how to go and how to do this grouping then it would be really great for me.
regards
ram -
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 -
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> -
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 -
** 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 ... -
File Content Conversion Problem
Hi
I have a flat file having 10 fileds with fixed length of field 7 characters
abc bcd dce cef ecf fgi
123 234 343 233 434 343
322 222 222 222 222 222
+++++++++++++++++++++++++++++++
XML CODE FOLLOWS
+++++++++++++++++++++++++++++++
<?xml version="1.0" encoding="UTF-8" ?>
- <ns0:MT_send xmlns:ns0="http://OTO-Continue.com">
-<SEND>
<abc>343</abc>
<bcd>343</bcd>
<dce>434</dce>
<cef>3434</cef>
<ecf>343</ecf>
<fgi>434</fgi>
</SEND>
</ns0:MT_send
As per the client req I'm going with FCC. The file is picking fine with the FILE. But not picking with the FCC.
The parameters which I gave are as follows.
SOURCE I feel it is fine since file is picking fine and keeping the same for FCC also.
PROCESSING
QOS -- Exactly Once
Poll Interval -- 10
Processing Mode -- Delete
Empty-File Handling -- Process empty files
CONTENT CONVERSION Parameters
Document Name -- (am giving sender data type name) DT_send
Document NSpace -- http://OTO-Continue.com
Recordset Name -- SEND
Recordset Structure -- SEND,*
Recordset Sequence -- Ascending
Recordset per Message -- 0
And in the table the parameters am settings are
SEND.fieldNames abc,bcd,cde,def,efg,ghk
SEND.fieldFixedLengths 7,7,7,7,7,7 (because each and every field has 7 characters)
SEND.keepIncompleteFields No
SEND.fieldFixedLengthType char
SEND.fieldContentFormatting trim
SEND.fieldEndSeparator 'nl'
This was the configuration. But this is not working I monitored the Communication Channel and file is not reading and not getting deleting.
What actually went wrong in above configuration. Why it is not working.
Thanks.Hi Swarna,
CONTENT CONVERSION Parameters
Document Name -- ?
DocumentNSpace -- ?
Recordset Name -- ?
Recordset Structure -- ?
Recordset Sequence -- Ascending
Recordset per Message -- ?
Document Name - <Message Type> eg:- (MT_ABC)
DocumentNSpace - Name space of your MT
Recordset Name - The root node( Which has one occurence)
Recordset Structure - The parent node of the fields(can have multiple occurences)
Recordset Sequence -- Ascending
Recordset per Message -- 1/* (No.of records per each record set)
In your structure
+++++++++++++++++++++++++++++++
XML CODE FOLLOWS
+++++++++++++++++++++++++++++++
<?xml version="1.0" encoding="UTF-8" ?>
- <ns0:MT_send xmlns:ns0="http://OTO-Continue.com">
-<SEND>
<abc>343</abc>
<bcd>343</bcd>
<dce>434</dce>
<cef>3434</cef>
<ecf>343</ecf>
<fgi>434</fgi>
</SEND>
</ns0:MT_send
There is no root node, so in your FCC you need to mention your RecordsetName and you can ignoreRecordSetName in result structure. Check the following blog simulates your requirement.
/people/anish.abraham2/blog/2005/06/08/content-conversion-patternrandom-content-in-input-file
Regards,
Prasanna -
Supress Column Heading - File Content Conversion in Sender Adapter
Hi,
Let me give a more clear picture about my scenario. I need to convert CSV File to XML output:-
My source file has column heading and values. The sample data is mentioned hereunder:-
PERNR;KID;PNALT;NACHN;NAME2;VORNA
;1200;1200;Angus
I have created a data type as under:-
DT_LegacyEmployee (Category - Complex Type)
Employees (Category - Element, Occurence - 1)
Header (Category - Element, Occurence - 0...1)
PERNR_H
KID_H
PNALT_H
NACHN_H
NAME2_H
VORNA_H
Employee (Categroy - Element, Type - DT_LegacyEmployee_Row, Occurence - 0...unbounded)
PERNR
KID
PNALT
NACHN
NAME2
VORNA
The file conversion parameters in the file sender adapter are mentioned hereunder:-
Document Name - MT_LegacyEmployee
Document Namespace - http://abc.com/xi
Recordset Name - Employees
Rescordset Structure - Header,1,Employee,*
Recordsets per Message - 1
Key Field Type - String (Case Sensitive)
Employee.fieldSeparator - ;
Employee.endSeparator - 'nl'
Employee.fieldNames - PERNR,KID,PNALT,NACHN,NAME2,VORNA
I dont' have a key field value. How do we remove the header and show only the values in the xml output. I have searched the forum topics as well checked many blogs related to file content conversion, but nothing helped. Kindly advice how to fix this issue. Thanks in advance.
Regards.
PraveenHi Praveen,
Change your File Adapter as below
Document Name - MT_LegacyEmployee
Document Namespace - http://abc.com/xi
Recordset Name - Employees
Rescordset Structure - Employee,*
Recordsets per Message - 1
Key Field Type - String (Case Sensitive)
Employee.fieldSeparator - ;
Employee.endSeparator - 'nl'
Employee.fieldNames - PERNR,KID,PNALT,NACHN,NAME2,VORNA
There is no need for the Header required in the data type.
DT_LegacyEmployee (Category - Complex Type)
Employees (Category - Element, Occurence - 1)
Employee (Categroy - Element, Type - DT_LegacyEmployee_Row, Occurence - 0...unbounded)
PERNR
KID
PNALT
NACHN
NAME2
VORNA
Now the trick is in the mapping program
Lets assume your mapping looks like
MT_LegacyEmployee ---> MT_TargetEmployee
- Employees ---> Records
- Employee ---> Record
- PERNR ---> TargetPERNR
- .. so on
When you do a mapping from Employee ---> Record apply the following logic.
(PERNR)--->
(TestEquals =) --->(NOT)--->
(Constant) ---> (IF)
(PERNR) (IF Without Else) ---> (Record)
(THEN)
(Employee)--->
When doing this make sure RightClick on PERNR and Select Context ---> Employees.
By default context would be from Employee and it will give you an error of XSD format. So make sure you are changing the context. -
Hello,
I have Async. File receiver scenario in which the following is the XML message structure. This is received by the file adpater.
<ns1:MT_Info_File xmlns:ns1="urn:http://freemanco.com/xi/info_list">
<TYPE>
<FileItem>
<FileName>DD11022007</FileName>
</FileItem>
</TYPE>
<DATA>
<LineItem> <LineEntry>234567891234567890123456789012345678901234567890</LineEntry>
</LineItem>
<LineItem>
<LineEntry>95473523647586969587265245437586979798376524253586</LineEntry>
</LineItem>
<DATA>
<LineItem</ns1:MT_Info_File>
<u><b>I want to write only folowiing DATA structure to file. I do not want to wite contents of TYPE structure</u>
<DATA>
<LineItem> <LineEntry>234567891234567890123456789012345678901234567890</LineEntry>
</LineItem>
<LineItem>
<LineEntry>95473523647586969587265245437586979798376524253586</LineEntry>
</LineItem>
<DATA></b>
In the receiver file adpater I have follwoing <u><b>File content conversion parameters</b></u>.
RecordSetStructure: DATA,LineItem,*
*.addHeaderLine 0
*.fieldFixedLengths 301
*.fixedLengthTooShortHandling Error
*.endSeparator nl
LineItem.fieldSeparator nl
DATA.fieldSeparator nl
While testing I got following error. Looks like it is expecting some values for FileItem element in the XML.
<b>Error</b> Attempt to process file failed with java.lang.Exception: Exception in XML Parser (format problem?):'java.lang.Exception: Message processing failed in XML parser: 'Conversion configuration error: Unknown structure 'FileItem' found in document', probably configuration error in file adapter (XML parser error)'
<b>Error</b> MP: exception caught with 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 'FileItem' 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 'FileItem' found in document', probably configuration error in file adapter (XML parser error)'
<b>Error</b> Exception caught by adapter framework: Exception in XML Parser (format problem?):'java.lang.Exception: Message processing failed in XML parser: 'Conversion configuration error: Unknown structure 'FileItem' found in document', probably configuration error in file adapter (XML parser error)'
<b>Error</b> Delivery of the message to the application using connection File_http://sap.com/xi/XI/System failed, due to: 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 'FileItem' 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 'FileItem' found in document', probably configuration error in file adapter (XML parser error)'.
How to resolve this issue? I appreciate your help.
Thank you,
BalajiBalaji,
I would suggest to remove FileItem and LineItem in your receiver datatype. They are increasing the hierarchy of your content conversion. If you do that then you will have
<ns1:MT_Info_File xmlns:ns1="urn:http://freemanco.com/xi/info_list">
<TYPE>
<FileName>DD11022007</FileName>
</TYPE>
<DATA><LineEntry>234567891234567890123456789012345678901234567890</LineEntry>
<LineEntry>95473523647586969587265245437586979798376524253586</LineEntry>
<DATA>
</ns1:MT_Info_File>
Then in content converstion give this parameters:
Record structure : TYPE,FileName,DATA,LineEntry
TYPE.fieldfixedlengths : 0
FileName.fieldfixedlenghts:0
DATA.fieldfixedlenghts:0
LineEntry.fieldfixedlengths:301
LineEntry.endSeparator:'nl'
Then it should work. Also you can use FileName in your variable substituition. Also please see this weblog on how to use FileName in variable substitution:
/people/sravya.talanki2/blog/2005/08/11/solution-to-the-problem-encountered-using-variable-substitution-with-xi-sp12
If you dont want to remove FileItem and LineItem then add these also in your content conversion. Then the parameters would be:
Recordset: TYPE,FileItem,FileName,DATA,LineItem,LineEntry
TYPE.fieldfixedlengths : 0
FileItem.fieldfixedlengths:0
FileName.fieldfixedlenghts:0
DATA.fieldfixedlenghts:0
LineItem.fieldfixedlengths : 0
LineEntry.fieldfixedlengths:301
LineEntry.endSeparator:'nl'
Regards,
---Satish
Maybe you are looking for
-
I am creating a book from our recent vacation. Each day of the vacation I have separated into different Events. I chose the first day/event and clicked create book.....have placed all the photos in various "slots" in the book and now want to add phot
-
This flash movie i try to watch always pauses, http://dv.ouou.com/swf/ouou.swf?id=38d7f45b65c94, anyone know why it takes so long to load even 2 seconds? I have IE 7 and Adobe Flash Player 9.
-
Hello Apple Fam...
Greetings to all apple users in all parts of the world...Please I need help in installing Windows on my MacBook Pro... Whenever i get to the bootcamp setup it always prompts me to insert a CD.. So I was wondering if it was possible to install windows
-
HI I want to create a cursor with a dynamic select, in other words, in the code,when i OPEN the cursor i want to change its query. How can i do? PS I have the 8.1.7
-
I've got a major script I use that performs .png saving every few seconds, but apparently there are some new compression options in CS6. Is there a way for me to have the script use the "Smallest / Slow" compression option if CS6 is in use? I curre