Content Conversion when each field is in a new line
Hi,
I have file format denoted with .SIF or .CIF. This file is organised like -
AB=asdas
BC=qweqwe
CD=lop;lk;lk
YZ=sdfsdf
In each line the data after the = is actually the value of the field. Few set of these fields could repeat. And a new record would start when ever a particular field starts again.
I would need to convert this particular file using file content conversion (May be to a flat XML, from where I would handle it to get structured in to hierarchical format). Is this possible using the default file adapter? Can a NEW LINE character can be used as the fieldSeparator? I did not try this as of now, but would want to know if any one of you have already dealt with such a file.
Thanks in advance.
VJ
A flat strucutre would also be fine for me like -
<row>
<AB>kjlkj<AB>
<BC>kljljk<BC>
<YZ>lkjljk<YZ>
<row>
At least if can get my data into this format.. I could manage anything later..!!
VJ
Similar Messages
-
Content Conversion without key field value
Hi all,
I want to do a content conversion which includes a record structure Header,1,Detail,*
I dont have any key field value in the header nor in the detail. Can this be achived using FCC or should i go for Java.
Rgds
AdityaHi Aditya,
I think if u having multiple records then one shud hav key fields,
pls check 4th point in this guide
https://www.sdn.sap.com/irj/sdn/wiki?path=/display/xi/troubleshooting%2bthe%2bfile%2badapter
Also check this discussion::File Content Conversion(SenderFileadapter) fields parameters
Thanks, -
How do I make content in a text field continue onto a new page?
I am creating a form and one of the pages contains a text field for an essay. I'd like the responses in this text field to carry onto new pages if they reach the end of the first page. How do I make new pages appear with only the continued text field? Thanks!
All right...
public class guiClient extends JFrame implements ActionListener {
static String userString;
static String currentFont;
String fontchoice;
String fontlist;
static JTextField userName = new JTextField();
public guiClient() {
super("My Client");
public guiClient() {
super("My Client");
// Create a ComboBox
GraphicsEnvironment gEnv = GraphicsEnvironment.getLocalGraphicsEnvironment();
String envfonts[] = gEnv.getAvailableFontFamilyNames();
Vector vector = new Vector();
for ( int i = 1; i < envfonts.length; i++ ) {
vector.addElement(envfonts);
JComboBox fontlist = new JComboBox (envfonts);
fontlist.setSelectedIndex(0);
fontlist.setEditable(true);
fontlist.addActionListener(this);
fontchoice = envfonts[0];
//Create a regular text field.
JTextField textField = new JTextField(10);
textField.setActionCommand(textFieldString);
textField.addActionListener(this);
public void actionPerformed(ActionEvent e) {
//if the action is from the textfield (e.g. user hits enter)
if (e.getActionCommand().equals(textFieldString)) {
JTextField fromUser = (JTextField)e.getSource();
if (fromUser != null){
//place user text in editor pane
//send message to server
if (userName.getText() != null) {
userString = userName.getText().trim();
out.println(userString + ": " + fromUser.getText());
fromUser.setText("");
else if (e.getActionCommand().equals(fontlist)){
JComboBox cb = (JComboBox)e.getSource();
String newSelection = (String)cb.getSelectedItem();
currentFont = newSelection;
userString = currentFont;
return; -
File content conversion without key field
Hi,
i have a input file with the following format:
posvalue1;posvalue2;posvalue3;posvalue4
posvalue1;posvalue2;posvalue3;posvalue4
posvalue1;posvalue2;posvalue3;posvalue4
posvalue1;posvalue2;posvalue3;posvalue4
posvalue1;posvalue2;posvalue3;posvalue4
footervalue1;footervalue2;footervalue3
footervalue1;footervalue2;footervalue3
i just need the information from pos lines and the footer is not needed. the only indicators are:
the empty line between
the number of fields
maybe i could use the keyfieldvalue:
in posvalue2 i have only numbers (diffrent) in footervalue2 i have only chars (diffrent)
has anyone an idee?
regards
J.Hi
yes you have to use the key field value as the posvalue1.
if you do not want the footer informatuion in the target side then inthe grahical mapping do not map footer fields with the target structure.
to convert the text file into XML file you can use the following parameters
RECORD.fieldSeparator :;
RECORD.fieldNames :KEY,FNAME,LNAME,AGE
RECORD.keyFieldValue :1
DETAIL.fieldSeparatr :;
DETAIL.fieldNames :KEY,SALARY,EMPID
DETAIL.fieldNames :2
Note:these parameters are accoding to the structure given below.
suppose you have a structure like as below
data (0..unbounded)
record (0..unbounded)
key (1..1)
fname (1..1)
lname (1..1)
age (1..1)
detail (0..unbounded)
key (1..1)
salary (1..1)
empid (1..1)
and the input file will look like as below
1,aaa,bbb,23
2,12000,10838
1,ccc,ddd,23
2,13000,10830
if you still face the problem please reply me back
Thanks
Rinku -
File content conversion Receiver with no key fields
hi all,
I have a header structure with four fields all varying and also item structure with varying fields .. how do i go about to solve this .. as the regular Content Conversion uses key fields.. but there are no such key fields here... kindly help in this regard to proceedIf you dont have a key field, then the only option to read the file and convert it to XML would be in a record row format.
Here each line will go as one field in the XML. You will have to use some logic in your mapping to extract the right field.
Ref: /people/sravya.talanki2/blog/2005/08/16/configuring-generic-sender-file-cc-adapter
but in case your is a receiver File adapter then key fields are not required.
ref: /people/arpit.seth/blog/2005/06/02/file-receiver-with-content-conversion -
When do we usually go for field content conversion ?
Our implementation uses field content conversion but I have no idea why it was at all used. Can anyone throw some light on this ?
Thanks,
Niveditahi nivedita,
i think it should be File Content Conversion instead of Field Content Conversion.
Anyways In File Content Conversions, you can convert a table in XML format to pure text format in this mode and vice versa. The expected XML structure contains the structure as nodes filled with any number of elements without additional sub node.
you can also Convert Fixed Length File and Comma Separated Value text file containing complex structures into an XML source format in this mode. The file contains various row formats in logical structures.into Xml form using FCC.
FCC is used in both sender and receiver communication channel.
For more information refer this link:
Converting File Content in a Sender Adapter
http://help.sap.com/saphelp_nw04/helpdata/en/33/c6e63b60c25767e10000000a11402f/frameset.htm
Converting File Content in the Receiver Adapter
http://help.sap.com/saphelp_nw04/helpdata/en/33/c6e63b60c25767e10000000a11402f/frameset.htm
Regards,
Mandeep Virk
*reward if helpful* -
Key field in File Content Conversion
Is Keyfield must be unique in FCC ?
Hi,
Check this to get more Clarity abt the Key Field Usage
Content Conversion ( The Key Field Problem )
Regards
Seshagiri -
File Adapter with Content Conversion
Hi -
I am trying to convert a Flat file which has data as
firstnamelastnamecompanyName
Now i have created a message type which has a root name as Contact and its children are FirstName,LastName,Company.
And in the configurator i have created a file adapter with the content conversion, but being very new to XI i have never used a file adapter with content conversion. This is what i have in my Content Conversion Parameters.Please correct my code.
Document Name :: MT_Contact
Document Namespace :: http://venkat
Document Offset :: <i>i did not enter anything here</i>
Recordset Name :: RootNode(i gave this name just like that,,, Should it be something from the IR??
Recordset NameSpace:: <i>i did not enter anything here</i>
Recordset Structure:: Contact (this is the name in my IR
Recordset Sequence :: Ascending
Recordsets per Message :: Contact,* (Can someone explain what should be given here)
Then in the bottom in the name value pairs i have given
Contact.fieldNames = FirstName,LastName,Company
Contact.fieldSeparator = #
When i am using the above configuration the error i am getting in RWB is Error: Conversion initialization failed: Exception: java.lang.Exception: java.lang.Exception: Error(s) in XML conversion parameters found:
Format error in 'xml.recordset' argument: incomplete structure (name,number) pairInvalid 'xml.recordsetsPerMessage' value 'Contact,*' found
I am very new to XI and i am unable to understand what exactly each field means in the file adapter when the content coversion is used. Can someone take the pain of explaining them.
Thank you
VenkatHi,
Use the following to create an XML strucutre like this,
<MT_CONTACT>
<CONTACT>
<FirstName> </FirstName>
<LastName> </LastName>
<CompanyName> </CompanyName>
</CONTACT>
<MT_CONTACT>
DocumentName : MT_TEST
DocumentNamespace : Yournamespace
RecordserName : record
RecordsetStructure : CONTACT,1
In the table,
ignoreRecordsetName : true
CONTACT.fieldNames : FirstName,LastName,CompanyName
CONTACT.fieldSeparator : #
Go through the links suggested by moorthy and also these blogs to understand content conversion better,
/people/anish.abraham2/blog/2005/06/08/content-conversion-patternrandom-content-in-input-file
/people/jeyakumar.muthu2/blog/2005/11/29/file-content-conversion-for-unequal-number-of-columns
/people/michal.krawczyk2/blog/2004/12/15/how-to-send-a-flat-file-with-fixed-lengths-to-xi-30-using-a-central-file-adapter
/people/shabarish.vijayakumar/blog/2006/02/27/content-conversion-the-key-field-problem
/people/sap.user72/blog/2005/01/06/how-to-process-csv-data-with-xi-file-adapter
Regards,
Bhavesh -
File sender content conversion 0..unbounded does not pull file
i am trying to map a flat file using content conversion to this xml structure:
<Header>
<Field_ID/>
<Filler/>
<Record_type/>
<File_name/>
<File_date/>
<File_time/>
<Heb_code/>
<Claim_no/>
<Cont_no/>
<Remark/>
</Header>
<Claim_Header>
<Field_ID/>
<Filler/>
<Record_type/>
<Vendor_code/>
<Garage_no/>
<Data_code/>
<Year/>
<Job_no/>
<Cont_no/>
<License_no/>
<ODO_meter/>
<Claim_type/>
<VIN_code/>
<Claim_open_date/>
<Claim_fix_date/>
<N_code/>
<C_code/>
<Ejob1/>
<Ejob2/>
<Page_no/>
<Pre_conf_date/>
<Pre_conf_no/>
<Part_buy_date/>
<KM_prev_fix/>
<Bill_prev_fix/>
<Material_fault/>
<Damage_whole/>
<Damage_code/>
<Job_amount/>
<Towing_amount/>
<Parts_amount/>
<Hour_rate/>
<Cont_mark/>
</Claim_Header>
<job_row>
<Field_ID/>
<Filler/>
<Record_type/>
<Vendor_code/>
<Garage_no/>
<Data_code/>
<Year/>
<Job_no/>
<Cont_no/>
<page_no/>
<line_no/>
<shaaton_code/>
<job_finish_code/>
<amount/>
<job_time/>
<row_value/>
<color_code/>
</job_row>
<part_row>
<Field_ID/>
<Filler/>
<Record_type/>
<Vendor_code/>
<Garage_no/>
<Data_code/>
<Year/>
<Job_no/>
<Cont_no/>
<page_no/>
<line_no/>
<material_code/>
<amount/>
<unit_price/>
<row_value/>
</part_row>
<remark>
<Field_ID/>
<Filler/>
<Record_type/>
<Vendor_code/>
<Garage_no/>
<Data_code/>
<Year/>
<Job_no/>
<Cont_no/>
<page_no/>
<line_no/>
<remark/>
</remark>
<footer>
<Field_ID/>
<Filler/>
<Record_type/>
<File_name/>
<File_Record_no/>
<Claim_no/>
<Cont_no/>
<Remark/>
</footer>
job_row, part_row and remark are records that occur 0..unbounded.
when i write in recordset structure: Header,1,Claim_Header,1,Job_Row,1,Part_Row,1,Remark,1,Footer,1
and put file with one record each, the file is pulled, but when i change recordset structure to:
Header,1,Claim_Header,1,Job_Row,* ,Part_Row,* ,Remark,*,Footer,1
the file is not pulled.
can anyone tell me what i'm doing wrong?
thanx
TomerHi,
Refer this links for FCC.
Introduction to simple(File-XI-File)scenario and complete walk through for starters(Part1)
Introduction to simple (File-XI-File)scenario and complete walk through for starters(Part2)
File Receiver with Content Conversion
Content Conversion (Pattern/Random content in input file)
NAB the TAB (File Adapter)
Introduction to simple(File-XI-File)scenario and complete walk through for starters(Part1)
Introduction to simple (File-XI-File)scenario and complete walk through for starters(Part2)
How to send a flat file with various field lengths and variable substructures to XI 3.0
Content Conversion (Pattern/Random content in input file)
NAB the TAB (File Adapter)
File Content Conversion for Unequal Number of Columns
Content Conversion ( The Key Field Problem )
The specified item was not found.
File Receiver with Content Conversion
http://help.sap.com/saphelp_nw04/helpdata/en/d2/bab440c97f3716e10000000a155106/content.htm
Regards,
Phani -
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 -
File is not creating on the Receiver for File Content Conversion
Hi,
i have created a scenario with this blog
/people/shabarish.vijayakumar/blog/2006/02/27/content-conversion-the-key-field-problem
for sender side i am using File Content Conversion to read .txt file and on receiver side i need xml file i have done that.
when i placed the file in the sender folder it gets picked up and i checked in Communication Channel monitporing in Runtime WorkBench it is processed Successfully. but no XML File is created on the Receiver side. i am unable to see the messages on SXMB_MONI also.
Please suggest some ideas to solve this.
Thanks,
Giridhar.CHi Giridhar.
unable to see the messages on SXMB_MONI also
If the file got picked and in Communication Channel monitoring RWB you can see that it is processed without any errors ,, then i feel it should come in come.Please check the Audit log in RWB, there you can see the error message if any.
Please check the connection parameters in FTP and make sure that the same sender folder is
not being used by any other scenario.If you have done any recent changes then do a cache refresh .
Please post if you see any error in content conversion.
Regards
Srinivas -
Sender File Adapter - Content Conversion
HI Friends,
I got a scenario where I need to convert the File to XML document through Sender file adapter..
My file looks like below.
BATCH1234........
12DASER123142JMM
237DSAFDLKC839890
45SDFLASJ90011
BATCH3455...
132FGAR
SD21352525
BATCH998898...
123145DSRTW
12FSTS
So there is a Header and Body for each record set..
My XML Structure is as follows.
<TimeStructure>
<TimeRecord>
<ControlRec>
<Field1>BATCH </Field1>
<Field2> ...</Field2>
</ControlRec>
<DataRec>
<F1> ...... </F1>
<F2> ...... </F2>
</DataRec>
</TimeRecord>
<TimeRecord>
<ControlRec>
<Field1> BATCH </Field1>
<Field2> ADFAS </Field2>
</ControlRec>
<DataRec>
<F1> ...... </F1>
<F2> ...... </F2>
</DataRec>
</TimeRecord>
</TimeStructure>
The blog <a href="/people/shabarish.vijayakumar/blog/2006/02/27/content-conversion-the-key-field-problem:///people/shabarish.vijayakumar/blog/2006/02/27/content-conversion-the-key-field-problem
is somewhat relevant to my requirement.
But the problem is I have the keyfield "BATCH" for my header file but don't have any <b>key field in the data record</b> of the input file.
Please help me out how to mention the configuration parameters.
Regards,
KumarHi,
If you don't have constant key value for your detail records, then you can not directly get the required xml.
So in this case, you can read all the records in a common Row model, i.e each record will be considered as a one row with all the values, and then split this row with Substring or java functions in the mapping.
Even you can do this in the Adapter module .
If you have key value for each record to identify then you can try with content conversion.
Regards,
Moorthy -
Sender File Adapter - File Content Conversion
Hello,
i do have a problem with the file content conversion at the sender file adapter.
I have configured the file content conversion with key field defined
keyfield: key
recordsetstructure is set as head,1,item,*
head.fieldSeparator |
head.beginSeparator |
head.endSeparator |
head.keyFieldValue H
head.fieldNames key,....
item.fieldSeparator |
item.beginSeparator |
item.endSeparator |
item.keyFieldValue I
item.fieldNames key,....
When i run it like this it will not read since it has a problem to identify the key fields.
When ever i change the whole logic to be not based on fieldseparator but on fixed length, everything is working perfectly fine.
but this unfortuantly doesn't help as i have no fixed structure for the rest of the fields.
also when i change the recordsetstructure to head,1,item,1 my file is also processed correctly, of corse only for the first line, it at least tells me that the file structure is correctly defined.
Can anyone help why the identification for the keyfields doesn't work with field names and separator but in the same set up with fixed lengths ?
thanks a lotHello All,
thanks for the helpful answers.
So i tried Jayan tip and removed the begin Separter.
Unfortuantly my file is really looking like this |H|...|...| for the header record
and for the item record |I|...|...| ( this was an" I" like in Item ...
In my opinion this means i really do have a begin seperator which is the same like the field separator.
When i removed it from both the file and the config it started to work.
So i wrote an java function which will trow away the first digit in this case and integrated it in my szenario.
So that when this file is read there is no | as a begin flag anymore.
And the whole thing starts to work, this sounds more like a bug then a feature but anyway i am happy.
so thanks a lot
Tina -
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 -
File content conversion: String with commas to CSV
Hi Experts,
I have the following structure
DATA (1..n)
...Result (1..1)
The Result field contains a string like below
a,b,c,d,e,f,g,h,i,j
How do I put this into File Content Conversion when I want the receiver to be a CSV file? One cell per letter.
Thanks in advance.Outbound: you could convert your flat file to xml at first. Make the necessary mapping to the destination structur.
http://www.riyaz.net/blog/xipi-file-content-conversion-for-simple-structure/
Inbound: Content convernsion from xml to csv.
/people/arpit.seth/blog/2005/06/02/file-receiver-with-content-conversion
/people/venkat.donela/blog/2005/03/03/introduction-to-simple-file-xi-filescenario-and-complete-walk-through-for-starterspart2
/people/anish.abraham2/blog/2005/06/08/content-conversion-patternrandom-content-in-input-file
Cheers
Serdar
Maybe you are looking for
-
<soapenv:Envelope xmlns:soapenv= "http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns="urn:xxx/xx/ecbs/object/" xmlns:quer="urn:xxx/xx/ecbs/object/Query"> <soapenv:Header/> <soapenv:Body> <ns:operation_Input> <quer:ListOfContact pagesize="100" startr
-
HP eprint iphone app doesn't work
I don't know what I'm doing wrong, but it doesn't see either of the printers on my wi-fi network. One is a Photosmart 2450 and the other is a laserjet.
-
Photo stream not updating in Photos on iMac
My photos stream is working on iPhone and iPad but not on the iMac - it accesses photos from about 10 days ago, that's from before Photos was installed but it won't automatically pick up new photos taken on iPhone or iPad since Photos replaced iPhoto
-
Exit code 7 on photoshop elements 11 installation
I keep receiveing exit code 7 while installing photoshop elements 11 for mac os (using os 10.8.2) I am using safe mode, have created a new admin, and have searched for the Adobe font that has been mentioned in all other threads with no avail. Any hel
-
Air for Android video object displays on orientation change
I have an Android app that plays a video using the normal video object, ie: var nc:NetConnection = new NetConnection(); nc.connect(null); stream = new NetStream(nc); stream.client = this ; stream.addEventListener(NetStatusEvent.NET_STATUS, statusHand