Sender File Adapter: Flat file content conversion to "multileveled" XML
Hi all,
I would like to do following conversion with file adapter:
- Input flat file schema:
A...
B,,,
C:::
- Desired XML form:
<mesage>
<A>
<B>
<C>:::</C>
</B>
</A>
</message
>
All found examples (internet or XI documentation) do offer only "flat" XML option:
<mesage>
<A>...</A>
<B>,,,</B>
<C>:::</C>
</message>
Does anybody have an idea ?
Thanx and regards
Jurica
File Adapters content conversion does not supprot such a nested strucutre currently.
The only format supported is the one shown in ths link,
http://help.sap.com/saphelp_nw04/helpdata/en/2c/181077dd7d6b4ea6a8029b20bf7e55/content.htm
Either write a module that will do this conversion or Change the datatye for the source to the format shown in help.sap.
Regards
Bhavesh
Similar Messages
-
Problem with reciver file adapter in the content conversion.
I have starnge situation where the fileds in the file created after the content conversion are center aligned.
Can someone let me know how to make it right aligned?
For eg, i have a field with Char(6) in the file it looks as follows:
1.23 -> | 1.23 |
10.23 -> |10.23 |
100.23-> |100.23|
I want it to be like this :
1.23 -> | 1.23|
10.23 -> | 10.23|
100.23-> |100.23|
Please let me know ASAP as its a critical issue for the customer.
Warm Regards,
Nilesh KumarHi Nilesh,
if You are using file content conversion on Sender Adapter, then do you java mapping between your two interfaces(sender and receiver)
use java.text methods for formatting the values according to your requirement.
first check the java API 1.4.2....
with in that check java.text.* methods
Also there will be lot of examples availble on internet on this. Check online.
Also check this link this will definitely solve issue
[http://www.iro.umontreal.ca/~vaucher/Java/tutorials/Formatting.html]
Sample code on this link
double x = 1.0 / 7;
for (int n = 1; n<5; n++)
System.out.println( "1/7 : " + format( x, n, -6)
+ format( x, n, 10));
Thanks
Gujjeti
Edited by: Praveen Gujjeti on Apr 16, 2008 6:16 AM -
MessageTransformBean in sender JMS Adapter flat file to xml conversion
Hi All,
The scenario is MQ (Flat File ) --->PI -
>Idoc
The flat file structure is
112233
AABBCC
The expected XML Structure after using MessageTransformBean in the sender JMS adapter is
<Record>
<Row>
<f1>11</f1>
<f2>22</f2>
<f3>33</f3>
</Row>
<Row>
<f1>AA</f1>
<f2>BB</f2>
<f3>CC</f3>
</Row>
</Record>
But I am getting 2 SEPARATE xml messages each with only one Row in it like the following
1st XML:
<Record>
<Row>
<f1>11</f1>
<f2>22</f2>
<f3>33</f3>
</Row>
</Record>
2nd XML:
<Record>
<Row>
<f1>AA</f1>
<f2>BB</f2>
<f3>CC</f3>
</Row>
</Record>
I would like to have one xml message with all rows in it.It seems the MessageTransformBean is not recognizing the end of line in the flat file.Do i need to use endSeparator explicitly.
I followed the "How to use Content Conversion in JMS Adapter " and configured the adapter,still no luck..
Any Help greatly Appreciated
Thanks,
CHi Chirag,
The parameter name sequence changes alphabetically by itself when I save and activate it eventhough I enter as it is in the document.How to stop changing this sequence or put it the order as required in the Module Processor.
Currently my sequence is
Transform.Class
Transform.ContentType
xml.conversionType
xml.documentName
xml.documentNamespace
xml.fieldFixedLengths
xml.fieldNames
xml.processFieldNames
xml.structureTitle
Let me know how to change the sequence ,if that is the issue.
Thanks,
C -
File Adapter: Flat-file to XML
New to the Oracle ESB.
I am using the file adapter to read in a fixed-length flat file, have mapped it to an xsd and now I just want to dump the resulting xml into a directory. I don't see an obvious way to do this without converting it back to a flat file (by pointing the file writer back to a similar flat file xsd). Missing something obvious?
Thank you!File Adapters content conversion does not supprot such a nested strucutre currently.
The only format supported is the one shown in ths link,
http://help.sap.com/saphelp_nw04/helpdata/en/2c/181077dd7d6b4ea6a8029b20bf7e55/content.htm
Either write a module that will do this conversion or Change the datatye for the source to the format shown in help.sap.
Regards
Bhavesh -
File Content Conversion i.e Flat file 2 Flat file
Hi guys,
I am new 2 SAP XI
and i am trying 2 do "Flat File To Flat File".
Input File contains following data:
Name:varun
Surname:rajaraman
Address:B-2
Employee no:8204
i.e Each Data is in separate Row.
Output File Should contain the following data:
I am varun rajaraman staying at B-2 bearing employee no. 8204.
(name,surname) (address) (Employee No.)
i.e data should be in a single row.
So, i have a problem of reading the data from input file i.e data from each row and transfering it into output file along with which i need 2 insert "i am " ,"staying at", etc.
pls tell me the procedure in detail.
Thanks and regards
santhosh rajaramanHi,
Check this links for file content convertion.
File content conversion sites
/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
/people/arpit.seth/blog/2005/06/02/file-receiver-with-content-conversion
/people/anish.abraham2/blog/2005/06/08/content-conversion-patternrandom-content-in-input-file
/people/shabarish.vijayakumar/blog/2005/08/17/nab-the-tab-file-adapter
/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
/people/venkat.donela/blog/2005/06/08/how-to-send-a-flat-file-with-various-field-lengths-and-variable-substructures-to-xi-30
/people/anish.abraham2/blog/2005/06/08/content-conversion-patternrandom-content-in-input-file
/people/shabarish.vijayakumar/blog/2005/08/17/nab-the-tab-file-adapter
/people/jeyakumar.muthu2/blog/2005/11/29/file-content-conversion-for-unequal-number-of-columns
/people/shabarish.vijayakumar/blog/2006/02/27/content-conversion-the-key-field-problem
/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/arpit.seth/blog/2005/06/02/file-receiver-with-content-conversion
http://help.sap.com/saphelp_nw04/helpdata/en/d2/bab440c97f3716e10000000a155106/content.htm
Regards,
Phani
Reward Points if Helpful -
Sender File Adapter with file conversion
Hi guys,
Im using a Sender File adapter with file conversion. The message to be processed has a structure with fixed lengths and in your content are some values that needs to be ignored.
An example:
value1 <b>value2</b> value3
I want to ignore <b>value 2</b> but I cant find a parameter for that! Do I need to define dummy fields on my data type and ignore those fields during mapping? Or there is a specific parameter for that?
Thanks in advance,
Ricardo.hi,
there always is another way:)
you can import the whole line to one field
and cut it inside the adapter module
(then you can define start and stop of the substring that you need to use)
but of course it's not standard even though it's quite easy to achieve in java
Regards,
michal
<a href="/people/michal.krawczyk2/blog/2005/06/28/xipi-faq-frequently-asked-questions"><b>XI / PI FAQ - Frequently Asked Questions</b></a> -
XML File to Flat File scenario: Reciver file adaptor content conversion
Hello Friends,
Currently I am working on XML File to Flat File Scenario.
I used receiver side File adaptor with content conversion.
My receiver side adaptor is giving error. Error is given below.
Conversion initialization failed: java.lang.Exception: java.lang.Exception: Error(s) in XML conversion parameters found: Parameter '.fieldFixedLengths' or '.fieldSeparator' is missing
My content conversion parameters are as:
row.fieldNames Customer_ID,Name,Address,Phone
row.fieldSeparator ,
row.processConfiguration FromConfiguration
row.endSeparator 'nl'
Can you please suggest me what kind of error is this?
Regards,
NarendraStill I am facing below given issue.
2010-06-08 15:34:25 Error File adapter receiver channel CC_Customer_FlatFile_Distination is not initialized. Unable to proceed: null
2010-06-08 15:34:25 Error Exception caught by adapter framework: Channel has not been correctly initialized and cannot process messages -
Error in Receiver File adapter using File content Conversion
Hi,
I am getting the following error in the receiver file adapter.
Conversion initialization failed: java.lang.Exception: java.lang.Exception: Error(s) in XML conversion parameters found: Parameter 'statement.fieldFixedLengths' or 'statement.fieldSeparator' is missing
I am using the below parameters for FCC:
Recordset Structure - statement
statement.endSeparator - 'nl'
statement.fieldSeparator - '0X09'
statement.fieldNames -xblnr,wrbtr,newbs,kostl,newko,prctr,xref1,rke_wwfud,rke_wwst3,blart,bukrs,bldate,budat,gjahr,monat,ctype,waers,bktxt,posnr,wbs_element,mwxkz,businessplace,businessplace,c_waers,c_wrbtr,g_ctype,g_waers,g_wrbtr,h_ctype,h_waers,h_wrbtr,trade_id,lob,sgtxt,zuonr,reason_rev,ldgrp,tcode,lifnr
ignoreRecordsetName - true
Please let me know where i am going wrong.
Thanks,
AparnaHi Aparna,
I feel the problem in your content conversion parameters is with
statement.fieldNames and ignoreRecordsetName
When you are confirguring receiver file adapter for file content conversion the above one is not required. Please refer below link for details on configuring content conversion in file adapter
[http://help.sap.com/saphelp_nw04/helpdata/en/bc/bb79d6061007419a081e58cbeaaf28/frameset.htm]
Hope this helps !!
Regards,
Amit -
Flat File to Flat File Scenario using File Adapter
Hi Experts,
In my scenario, requirement is Flat File to Flat file through File Adapter in PI. At sender end, we would need to use Sender File Adapter (NFS) and receiver end we would need to use Receiver File Adapter (FTP). File would be coming as a encrypted format, and the file needs to be sent in encrypted format.
Any idea how to proceed with this requirement would be helpful.
Thanks and Regards
SoumyaHi Soumya,
You need to choose the FTP in the "transport protocol" option. Then in the FTP connection parameters choose the option Connection Security and assign the value "FTPS for control and Data Connection". Then the "Command Order" will show up below that option and you could leave the default value itself. If you are using Public private key certificates of X.509 then you could choose the option "Use x.509 certificate for client authentication" and assign the values to the "keystore" and "certificate & private key" fields.
Note: To use the FTP with SSL you need to add the CA certificate to the TrustedCAs keystore view.
Regards,
Vishnu. -
Content conversion for multilevel varying structure File to Idoc
Hi All,
I have following file structure.
VO
C1
S1 1 to unbounded
H1 1 to unbounded
D1 0 to unbounded
D2 0 to unbounded
U2 0 to unbounded
UC 0 to unbounded
My Idoc structure.
ISU_EL34
IDOC 0 to unbounded
E1ISU34 1 to unbounded
ZSEGMENT 0 to 1
I have applied the content conversion for the length specific file as follows.
Recordset structure: VO,1,C1,1,S1,1,H1,1,D1,,D2,,U2,,UC,
Do I need to do any changes over here to satisfy the above file structure.
V0 and C1 occurs only once in a file.
for S1 I should have H1 compulsory and others are optional, but i need to create Idoc when D1 data is available only.
I'm able to read the total file with the above content conversion.
MY requirements:
1) I need to create the Idoc based on the occurance of D1 node. I'm using H1 data also in the idoc not S1.
2) My doubt is whether the content conversion I have provide is applicable to the structure I have prepared.
3) When I'm trying useOneAsMany function for the above ie H1 data should repeat in Idoc as and when D1 repeats.I'm failing the error is both queues are not contain same number of data..
Could anyone suggest how I should approach for the above scenario.Hi Sravya,
It is really helpfull answer , Thanks for sharing my problem .
It worked for this purpose, but I'm facing following problems
MY scenario
The file contains records V0,C1,S1,H1,D1,D2,U2 and Uc
In which Im using the data of H1,D1,D2,U2 and UC for creating target Idoc.
Every H1 contains at least 1 D1 record, If D1 exists D2 ,U2 and UC may or may not exist.If exists those are in a sequence and should consider the data of them to create Idoc.
Idoc should be created for every D1.
Problem facing:
Do we have any mechanism to group the D1 records to the relevant header.since Im unable do this with content conversion.
I think bcz of above problem; some records (D2 & U2 & UC) data is populating in Idoc even there is no D2,U2 and Ucs.
Thanks,
venu. -
Reg error in flat file to flat file scenario
Hi techies,
Iam just starting working with XI scenarios.
In base flat file to flat file scenario which is mentioned in wiki.sdn
http://wiki.sdn.sap.com/wiki/display/XI/FLATFILETOFLATFILE
I had completed entire scenario. After generating sender file. Iam getting this error in runtime work bench.
Conversion initialization failed: java.lang.Exception: java.lang.Exception: Error(s) in XML conversion parameters found: Parameter 'CONTACTS.EMP.fieldFixedLengths' or 'CONTACTS.EMP.fieldSeparator' is missing
Please suggest how to resolve this error.
Thanks in advance,
Regards,
KiranHi,
From your error description,
Conversion initialization failed: java.lang.Exception: java.lang.Exception: Error(s) in XML conversion parameters found: Parameter 'CONTACTS.EMP.fieldFixedLengths' or 'CONTACTS.EMP.fieldSeparator' is missing
it is clear that you have missed out either or both the 2 parameters in receiver file adapter content conversion, namely EMP.fieldFixedLengths and EMP.fieldSeparator.
From the example that you followed, use the following values for the 2 parameteres is the output file is a comma separated file:
EMP.fieldFixedLengths: 8,10,10
EMP.fieldSeparator: ,
I have assumed that the lengths of the fields NAME,ADD,MOBILE are 8,10 and 10 respectively. Change them according to your requirement.
Use any other value in place of comma(,) in EMP.fieldSeparator according to the requirement.
Hope it helps you buddy!!!
Thanks
Biswajit
Edited by: 007biswa on Feb 22, 2011 9:25 AM
Edited by: 007biswa on Feb 22, 2011 9:28 AM -
Hi,
I am doing an interface (Flat file to Flat file)
The input file fields are separated by delimiter @!.Which will have multiple records like LEVEL1,LEVEL2,LEVEL3
Input Flat file
Level1@!PoNo@!ShortText@!StDate@!EndDt@!Vendor@!Status
Level2@!PoNo@!L2id@!L2desc@!L2stdt@!L2ensdt@!L2plant@!order
Level3@!PoNo@!L2id@!L3id@!L3stdt@!L3enddt@!order
Level1@!PoNo@!ShortText@!StDate@!EndDt@!Vendor@!Status
Level2@!PoNo@!L2id@!L2desc@!L2stdt@!L2ensdt@!L2plant@!order
Level3@!PoNo@!L2id@!L3id@!L3stdt@!L3enddt@!order
Level1@!PoNo@!ShortText@!StDate@!EndDt@!Vendor@!Status
Level2@!PoNo@!L2id@!L2desc@!L2stdt@!L2ensdt@!L2plant@!order
Level3@!PoNo@!L2id@!L3id@!L3stdt@!L3enddt@!order
Output file
The outfile fields are separated by tab delimiter
<L1> L1Pono L1desc L1stdt L1enddt L1hr L1cost L1vendor L1misc L1status
<L2> L1Pono L2ID L2desc L2stdt L2enddt L2priority L2loc L2plant L2order
<L3> L1Pono L2ID L3ID L3desc L3stdt L3enddt L3work L3emp L3order
The outfile fields are separated by tab delimiter
<L1> L1Pono L1desc L1stdt L1enddt L1hr L1cost L1vendor L1misc L1status
<L2> L1Pono L2ID L2desc L2stdt L2enddt L2priority L2loc L2plant L2order
<L3> L1Pono L2ID L3ID L3desc L3stdt L3enddt L3work L3emp L3order
Do I need to use file content conversion?how do I replace the delimiter?
Can you please tell me how to do this,appreciate you help.Let me know if you need more info.
Points will bw rewarded
ThanksHi Guys,
Thanks for all the replies.I have done all necessary things for sender and reciver communication channels.I am pretty sure the sender CC is fine,but I am not sure of the receiver CC.The file is not being picked up at the sender side.In went and saw the adapter monitoring,it shows me the below error
Receiver Adapter v2405 for Party '', Service 'BS_XIX_010':
Configured at 2008-04-21 09:44:11 CDT
History:
- 2008-04-21 09:44:11 CDT: Error: Conversion initialization failed: Exception: java.lang.Exception: Error(s) in XML conversion parameters found:
Parameter '1.fieldFixedLengths' or '1.fieldSeparator' is missing
In the receiver CC I am giving the following details,is there anything I am missing,do I need to check the Advanced mode in the CC and give info there?
LEVEL1.fieldSeparator ,
LEVEL2.fieldSeparator ,
LEVEL3.fieldSeparator ,
LEVEL1.endSeparator 'nl'
LEVEL2.endSeparator 'nl'
LEVEL3.endSeparator 'nl'
Thanks -
Flat File to Flat File scenario
Hi all,
I have a flat file to flat file scenario. I pick up a file in a specific format and produce a flat file in tab delimited format after some mapping.
Everything is ok. All the functionality is working perfectly. However, there is one small error. In case the source file is empty, there is an error message in SXMB_MONI (which is correct as there is no XML content) but I still need to generate an empty output file.
Is this possible ? Can I change something at the 'File Content Conversion' level ?
Any advise will be highly appreciated.
Thanks,
Freddy.Hi Freddy,
>>>Problem while determining receivers using interface mapping: Error while determining root tag of XML: BOM / charset detection failed.
The charset of the XML cannot be determined. That is written clearly in the message.
Is your XML belongs to UTF-16 or UTF-32? Then it needs a BOM which is missing.
Have a look at below link.
http://en.wikipedia.org/wiki/Byte-order_mark
Check, if there is an XML header and which charset is mentioned.
Regards,
P.Rajesh -
Procedure to save the output of a query into excel file or flat file
Procedure to save the output of a query into excel file or flat file
I want to store the output of my query into a file and then export it from sql server management studio to a desired location using stored procedure.
I have run the query --
DECLARE @cmd VARCHAR(255)
SET @cmd = 'bcp "select * from dbo.test1" queryout "D:\testing2.xlsx;" -U "user-PC\user" -P "" -c '
Exec xp_cmdshell @cmd
error message--
SQLState = 28000, NativeError = 18456
Error = [Microsoft][SQL Server Native Client 10.0][SQL Server]Login failed for user 'user-PC\user'.
NULL
Goel.AmanHello,
-T:
Specifies that the bcp utility connects to SQL Server with a trusted connection using integrated security. The security credentials of the network user,
login_id, and password are not required. If
–T is not specified, you need to specify
–U and –P to successfully log in.
-U:
Specifies the login ID used to connect to SQL Server.
Note: When the bcp utility is connecting to SQL Server with a trusted connection using integrated security, use the
-T option (trusted connection) instead of the
user name and password combination
I would suggest you take a look at the following article:
bcp Utility: http://technet.microsoft.com/en-us/library/ms162802.aspx
A similar thread regarding this issue:
http://social.msdn.microsoft.com/Forums/sqlserver/en-US/b450937f-0ef5-427a-ae3b-115335c0d83c/bcp-connection-error-sqlstate-28000-nativeerror-18456?forum=sqldataaccess
Regards,
Elvis Long
TechNet Community Support -
File Adapter or File Transport which one will give more performance
Hi all,
File Adapter or File Transport which one will give more performance ? in OSB?
Which one to select any one did performance analysis?
Thanks
PhaniWhy don't you just go read some benchmarks?
http://www.barefeats.com/mbpp18.html
Maybe you are looking for
-
How to change the desription of a standard SAP field in the Search Help
Hi All, In Table T023T there is a field WGBEZ60(Long text describing the material group) and the data element of the field is WGBEZ60. Requirement is to change the description of the field WGBEZ60.The desription of the field is - Description 2 for t
-
Problem in printing continuous invoices
Hi, WA_LISTHEADER-TYP = 'S'. WA_LISTHEADER-KEY = TEXT-029. IF NOT S_VBELN-HIGH IS INITIAL. CONCATENATE S_VBELN-LOW TEXT-030 S_VBELN-HIGH INTO WA_LISTHEADER-INFO+24 SEPARATED BY ''. ELSE. WA_LISTHEADER-INFO = P_PLANT. ENDIF. APPEND WA_
-
Lightroom 4.4 not recognizing RAW files from supported cameras
I started to get problems with Lightroom not recognizing RAW files from my Fuji XE-1 and Canon 5D Mark 3 cameras but I thought it was a problem with RC. After downloading some files today in 4.4 without a problem I encountered the same error message
-
Best practice for Book recording vocals...
My wife has written a children's book that we want to record and offer as a downloadable MP3 set. She will do the recording and we have the mic/studio GarageBand all working just fine. My question is what is the best way to make sure that all the tra
-
Organizer - how do I fix missing thumbnails?
After processing RAW files in PE9 and saving as JPEG's, there seems to be a random number of resulting files which fail to show as thumbnails in Organizer. Instead there's the grey flower/exclamation mark thumbnail. The file clearly exists - Properti