Key field from content - Sender file adapter content conversion
I am reading a source CSV file that has this structure. All rows in the source file are the same structure: line items of a PO. But there will be multiple POs in a single file, identified by the PO number as one column in the file.
PONum,LineItemNum,Qty,Description
001,1,34,Carrots
001,2,17,Apples
001,3,22,Bananas
002,1,4,Mangos
002,2,9,Coconuts
003,1,44,Grapes
Goal is to generate 3 messages, one for each PO:
<po>
<num>001</num>
<line_items>
... 3 line items for PO # 001 ...
</line_items>
</po>
<po>
<num>002</num>
<line_items>
... 2 line items for PO # 002 ...
</line_items>
</po>
<po>
<num>003</num>
<line_items>
... 1 line item for PO # 003 ...
</line_items>
</po>
Is there any way to use the Content Conversion Key Field Name to group the line items into the correct 3 messages? "Key Field Name" expects a static identifier for each type of row; but mine varies by the PO number in the content.
Or do I need to do this in the mapping? If so, what is the easiest way to split 1 large message of all line items into multiple target messages based on the PO number? (I assume this is better than sending individual line item messages and aggregating them later, as long as the file size is OK.)
Thanks in advance!
RBL
Edited by: Robert Burfoot-Lobo on Apr 8, 2009 11:43 AM
Hi Robert,
If ur goal is to split into 3 messages one for each PO, you can go for message split and using graphical mapping you can achieve that.
Within the message mapping go to the tab Messages.
Change the occurrence of the target message to 0..unbounded.
Also this link may help you.
/people/claus.wallacher/blog/2006/06/29/message-splitting-using-the-graphical-mapping-tool
Regards,
Madhu
Similar Messages
-
In the interface file to proxy key field in the sender file adapter
Hi all
i do have a FLAT FILE ,
1820000000|
0010|XXX
0020|XXX
0040|XXX
0050|XXX
where 1820000000 is my PO number and 0010|ACK
0020|XXX
0040|XXX
0050|XXX
i dont what to use key field for this case in my sender adapter configuration please help me
thanking youHI
Read the file without using key field. Just define the FCC parameters Header and Items PI will pick the file.
DT_Source
Record
Header 0..1
PO_Number String 0..1
Items 0..unbounded
Items String 0..1
Do the FCC
Header.fieldnames PO_Number
other config for Header
Items.fieldnames Items
other config for items
Thanks
Gaurav
Edited by: Gaurav Bhargava on Nov 12, 2008 10:27 AM
Edited by: Gaurav Bhargava on Nov 12, 2008 10:27 AM -
Key Field Value in Sender File Adapter
Hi,
I am having a File>XI>File scenerio.
The incoming file is having a fixed length content and is coming in as a single Header and multiple Line Item records. The single header is the first record and the rest are line item.
The problem is that we do not have a keyfield, for the header as well as the Item records.
Is there any possible configuration that I can do to still read the file; without specifying the parameters, xml.header.keyFieldName & xml.Header.keyFieldValue for the header and xml.Item.keyFieldName & xml.Item.keyFieldValue for the Item structures in which I would like to read my data.
I am curretly using SP12.
Regards,
AnshulHi Mohan,
The Source File is coming like below:
121000248 xyz 20051215120158
9600193091 1000000 1000000 JEN'S TEST 9600193091 1000001 1000001
9600193091 1000002 1000002 HSI METAL 9600193091 1000003 1000003
First record will always be a header and the rest of the records will be Item records.
Note: There will always be one header in the File.
The problem is that we do not have a keyfield, for the header as well as the Item records
Is there any possible configuration that I can do to still read the file; without specifying the parameters, xml.header.keyFieldName & xml.Header.keyFieldValue for the header and xml.Item.keyFieldName & xml.Item.keyFieldValue for the Item structures in which I would like to read my data.
Data type Structure is like :
<b>Header</b>
bankl
name
<b>Item</b>
AcountNo
CheckNo
Payee
If you need further clarification please do let me know. -
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 - content conversion question
Hi all
We have a .csv file to be passed to XI that has column headings as well. Is there a way of stripping the header using "Content conversion". We declared the RecordsetStructure as "header,1,item,*" but then it needs a keyFieldname and identifier which is obviously not available as the first line only has column headings.
Hoping for a reply soon.
Thanks
SalilSalil,
In RecordsetStructure you define as header,1,item,9999999999. But if you have more than 9999999999 records then the extra records after this will come as a second file.
If you expect more item records then increase the number of 9's. Then we dont need to give the key field.
---Satish -
Sender file adapter content with repeating structure
i have a scenario where my source file could have the following structure:
node1 (1:1)
node2 (0:1)
node3 (0:n)
node1 (1:1)
node2 (0:1)
node3 (0:n)
each node will have many fields. the three different nodes can repeat like this unbounded times. how would i define my content conversion and my data type to capture this structure? any help is appreciated.hi chris,
make your Content Conversion Parameters as:
Document Name "your doc_name"
Document Namespace "your name space"
Recordset structure node1,1,node2,1,node3,*,
Key Field Name Record Type
Key Field Type String
To differentiate the incomings to each nodes, we need a key value
say 01 for each node1 (you can use your own) *
Entry in FCC (below table)
node1.fieldFixedLengths "enter the length of the fields separated by commas
node1.fieldNames "specify the actual fieldnames separated by comma (no whitespace)
node1.keyFieldValue "enter the key value - for node1 i took as 01" *
make same entries for all the nodes
thanks n regards,
nikhil bos
<i>reward if helpful -
Sender File Adapter-Content conversion for a tab delimited file
Hi all,
I have a FIle to IDoc scenario, where the File is with the structure Header,Detail,Trailer.
Header and Trailer are with fixed field lengths, whereas the detail records are tab delimited.(Functional spec says delimited by H'05').
I have given the parameters as follows:
Header.keyFieldValue H
Header.fieldFixedLengths 1,1,4,1,8
Header.fieldNames a,b,c,d,e
Header.endSeparator 'nl'
Detail.fieldNames a,b,c,d,e,f
Detail.fieldSeparator '0h05'
Detail.keyFieldValue LOA
Detail.endSeparator 'nl'
Trailer.fieldFixedLengths 1,1,8
Trailer.fieldNames a,b,c
Trailer.keyFieldValue T
ignoreRecordsetName true
In SXMB_MONI, I get the payload with just the Header and Trailer and not the detail records, even though my file has so many records in it.I m pretty sure, this happens because of my Detail.fieldSeparator parameter.
Can anyone please help me with this?What is the correct value for this parameter?
Thanks a lot in advance!
Anjana.first of all make sure with a hex editor that the hex code of the delimiter sign is really 05. This is an odd character, as the normal tab is hex 09.
when you have confimred it, check online help for file adapter config for the correct entry of hex codes. I think it is something like '0x05',
Edited by: Stefan Grube on Feb 10, 2011 6:43 PM -
Sender File Adapter content conversion problem
Hi all,
is it possible to do content conversion like this:
Key;Field1;Field2;Field3
PO00H;0482000000;20061102;PL61
PO01I;00010;0A720;Material 1;100.000
PO02D;20061102;100.000;
PO00H;0482000001;20061102;PL63
PO01I;00010;0A730;Material 2;40.000
PO02D;20061102;40.000;
PO01I;00010;0A740;Material 3;140.000
PO02D;20061102;30.000;
PO02D;20061103;110.000;
convert to
<?xml version="1.0" encoding="utf-8" ?>
<MT_PO>
<DT_PO>
<DocumentHeader>
<PONumber>0482000000</PONumber>
<PODate>20061102</PODate>
<CompanyCode>PL61</CompanyCode>
</DocumentHeader>
<Item>
<ItemHeader>
<ItemNumber>00010</ItemNumber>
<MaterialCode>0A720</MaterialCode>
<MaterialDescription>Material 1</MaterialDescription>
<Quantity>100.000</Quantity>
</ItemHeader>
<ItemDetail>
<DeliveryDate>20061102</DeliveryDate>
<Quantity>100.000</Quantity>
</ItemDetail>
</Item>
</DT_PO>
<DT_PO>
<DocumentHeader>
<PONumber>0482000001</PONumber>
<PODate>20061102</PODate>
<CompanyCode>PL63</CompanyCode>
</DocumentHeader>
<Item>
<ItemHeader>
<ItemNumber>00010</ItemNumber>
<MaterialCode>0A730</MaterialCode>
<MaterialDescription>Material 2</MaterialDescription>
<Quantity>40.000</Quantity>
</ItemHeader>
<ItemDetail>
<DeliveryDate>20061102</DeliveryDate>
<Quantity>40.000</Quantity>
</ItemDetail>
</Item>
<Item>
<ItemHeader>
<ItemNumber>00010</ItemNumber>
<MaterialCode>0A740</MaterialCode>
<MaterialDescription>Material 3</MaterialDescription>
<Quantity>140.000</Quantity>
</ItemHeader>
<ItemDetail>
<DeliveryDate>20061102</DeliveryDate>
<Quantity>30.000</Quantity>
</ItemDetail>
<ItemDetail>
<DeliveryDate>20061103</DeliveryDate>
<Quantity>110.000</Quantity>
</ItemDetail>
</Item>
</DT_PO>
</MT_PO>Ivan,
I fear this is not possible.
You can have
<?xml version="1.0" encoding="utf-8" ?>
<MT_PO>
<DocumentHeader>
<PONumber>0482000000</PONumber>
<PODate>20061102</PODate>
<CompanyCode>PL61</CompanyCode>
</DocumentHeader>
<ItemHeader>
<ItemNumber>00010</ItemNumber>
<MaterialCode>0A720</MaterialCode>
<MaterialDescription>Material 1</MaterialDescription>
<Quantity>100.000</Quantity>
</ItemHeader>
<ItemDetail>
<DeliveryDate>20061102</DeliveryDate>
<Quantity>100.000</Quantity>
</ItemDetail>
</MT_PO>
Multiple <Item header> and multiple <Item details>
Do the content conversion like this and then in mapping, convert it to any structure you need.
Regards,
JaiShankar -
Sender file adapter with content conversion Simple XML
Hi experts,
I'm trying to parametrize my sender file adapter content conversion.
I'm receiving a text file with one single line like:
AA1;AA2; AA3;
and I want to convert it to an XML like
<MT_A1>
<field1>AA1</field1>
<field2>AA2</field2>
<field3>AA3</field3>
</MT_A1>
Actually I know how to do somenthing like
<MT_A1>
<LINE>
<field1>AA1</field1>
<field2>AA2</field2>
<field3>AA3</field3>
<LINE>
</MT_A1>
What I want is remove the <LINE> tag from my XML.
Regards
Gonzalo
Edited by: Gonzalo del Castillo on Nov 28, 2008 2:18 PMHi
Use this help document for receiver FCC
http://help.sap.com/saphelp_nw04/helpdata/en/d2/bab440c97f3716e10000000a155106/content.htm
Content Conversion (Pattern/Random content in input file)
File conversion text to xml (Few Last Post) -
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 Problem: Sender File Adapter
Hi All,
In Sender File Adapter, how to spilt the single line into different lines using + as a separator. Plz see below my source file.
#SMESS=IV01:672633SAP:676968:::NL51:02:11+
COPS=678713:676968:070416:IV01'3:11IVFR=678713:PDA and'IND 2'9206 AD'Dtn'INIVDA=070416IVNR=6264008195:676968add1
#EMESS=0+
In above txt file there are 3 lines.
1st line starts with #SMESS
2nd line starts with COPS
3rd line starts with #EMESS.
In 2nd line, if u observe there are 3 lines separating by +. My task is, I have to spilt the 2nd line into 3 lines using + separator.
I already used the xx.endSeparator as '+' to spilt the line but it is not working....
Could anyone help me how to do this. This is very urgent
Thnx,
Kumar.Hi Shankar,
1) My Expected XML Structure:
<?xml version="1.0" encoding="utf-8" ?>
- <ns:MT_IV01 xmlns:ns="http://ms.com/dev/ms">
- <Recordset>
- <DT_SMESS>
<D_9901>IV01</D_9901>
<D_9902>672633SAP</D_9902>
<D_9903>676968</D_9903>
<D_9904 />
<D_9905 />
<D_9906>NL51</D_9906>
<D_9907>02</D_9907>
<D_9908>11</D_9908>
</DT_SMESS>
- <DT_COPS_2>
<D_C022>678713</D_C022>
<D_C023>676968</D_C023>
<D_C008>070416</D_C008>
<D_C111>IV01'3</D_C111>
<D_H559>11</D_H559>
</DT_COPS_2>
- <DT_IVFR_2>
<D_C024>678714</D_C024>
<D_D333>PDA and'IND 2'9206 AD'Dtn'IN+</D_D333>
</DT_IVFR_2>
- <DT_IVDA_2>
<D_D365>070416</D_D365>
</DT_IVDA_2>
- <DT_IVNR_2>
<D_D189>6264008195</D_D189>
<D_H364>676968add1</D_H364>
</DT_IVNR_2>
- <DT_EMESS>
<D_D9901_1>0</D_D9901_1>
</DT_EMESS>
</Recordset>
</ns:MT_IV01>
2) I am not getting any error even if I use key Fields or Not becoz in the RecordSet Structure I mentioned DataType, 1 instead of DataType, *.
3) FCC Parameters:
Document Name: MT_IV01
Document Namespace: http://ms.com/dev/ms
Recordset Structure: DT_SMESS,1,DT_COPS_2,1,DT_IVFR_2,1,DT_IVDA_2,1,DT_IVNR_2,1,DT_EMESS,1
Recordset Sequence: Ascending
Key Field-type : String (Case-sensitive)
4) Error:
Conversion of file content to XML failed at position 0: java.lang.Exception: ERROR converting document line no. 2 according to structure 'DT_COPS_2':java.lang.Exception: ERROR in configuration: more elements in file csv structure than field names specified! -
Sender file adapter Adapter with out Key field
Hi All
i do have have a requirment ,Sender file adapter , for FCC but file is with out Key field
HEADER>
<DATA1>
<DATA2>
<DATA3>
<HEADER> file structure
<ITEM>
<ITEM1>
<ITEM2>
<ITEM3>
<ITEM
and the file si
'10001,20081902,US
10,soda,1
30,soda,4
40,soda,5
10002,20081902,US
10,steel,1
30,steel,4
40,steel,5
, and i need to identify the Header and Item using there lenght only , please anyone as idea abt this help meWhy to post the same question TWICE... in 30 min ? you don't like the answers ?
File content Conversion Issuse for a Sender File Adapter -
Key field value in outbound/sender file adapter
Hi,
I have a flat file coming in PI. The structre for the same is
1. Detail record line ocurs n number of time
2.Summary record line occurs only once at the end
I have defined a datatype as follows
<DT>
<Recordset>
<Detail>
All the detail fields
</Detail>
<Summary>
All the summary fields
</Summary>
</Recordset>
</DT>
Now the number of detail record is not know. But there is only one summary record.
In the sender file adapter do we need to configure the keyfield paramter? If the number of detail record is * .
The problem is the input file does not has any key field to parse/identify the detail or sumary record.
Any alternative?
Thankshi ,
if you have two structures so do like this:
Recordset strucrure detail,summary*
detail.fieldFixedlength : 10,20
detail.fieldNames : xxx,yyy
summary.fieldFixedlength : 10,20
summary.fieldNames : www,vvv
rest configuration will be same.
hope this will help.
regards
HONEY -
Sender file Adapter without Key field
my File structure will be as follows
<HEADER>
<DATA1>
<DATA2>
<DATA3>
<HEADER>
<ITEM>
<ITEM1>
<ITEM2>
<ITEM3>
<ITEM>
WHERE i do have flat file will be as follows
10001,20081902,US
10,soda,1
30,soda,4
40,soda,5
10002,20081902,US
10,steel,1
30,steel,4
40,steel,5
how to pick this file using FCC from sendere flat file adapter without keyfields , and i can use fixed length alsoHi,
with multiple nodes structure( like header and item in your case) you need to have a key field to process this file to a desidered structure using FCC.
Alternatively you can pick all these records as a single node type and classify it as header/items in your mapping by identifiing how each one differs frm other.
~SaNv... -
File content Conversion Issuse for a Sender File Adapter
Hi All ,
I am working for a Migration project , so my File structure will be as follows
<HEADER>
<DATA1>
<DATA2>
<DATA3>
<HEADER>
<ITEM>
<ITEM1>
<ITEM2>
<ITEM3>
<ITEM>
WHERE i do have flat file will be as follows
10001,20081902,US
10,soda,1
30,soda,4
40,soda,5
10002,20081902,US
10,steel,1
30,steel,4
40,steel,5
how to pick this file using FCC from sendere flat file adapter without keyfields , and i can use fixed length alsoSridhar,
You can use a work around like this. Create a generic Data Type something like below.
<Message Type>
<Recordset> - root node
<ROW> - element with occurence 0..unbounded
Now create an outbound MI with the above MT, in FCC in sender file adapter, give Recordset structure as ROW, *
This way , you will read the entire file inside XI as an XML like below
<ROW> header record </ROW>
<ROW> item record 1 </ROW>
<ROW> item record 2 </ROW>
<ROW>....</ROW>
In XI , since your header row & item rows are fixed length, now, you can use that in a UDF in your message mapping , or parse the xml using DOM parser in Java mapping, you should be good. Hope this helps.
~Saravana
Maybe you are looking for
-
Favoritos somem e retornam errados depois de importação
Atualizei o navegador firefox para a versão 24 release, utilizei ele normalmente e apos fechei e quando iniciei ele de novo os favoritos tinham todos sumidos, como eu venho tendo o mesmo problema desde a versão 20, eu sempre faço backup dos favoritos
-
Need to write trigger to caputre all the sql fired by a terminal or osuser
Hi everyone Can anyone please let me know the trigger through which i can capture all sql fired by particular Terminal or OSUSER thanks
-
Itunes won't open after restore...
I had to restore my computer and now when I try and open itunes I get this message: +The file "itunes library.itl" cannot be read because it was created by a newer version of itunes.+ Anyone care to chime in and help me out. I hope I have not lost my
-
I was using my Iphone 4 and it suddenly stopped working.
I was using my Iphone 4 and it suddenly stopped working. I thought the battery had just worn out really quickly or i'd not charged it last night. My phone is presently plugged in and not even a battery charge appears. I've had my phone for 16 months
-
Sonic Update Manager errors after updating to blackberry desktop v 6
I updated my Blackberry desktop software to version 6.0, I am now getting a popup from Sonic Update manager that wants to install some sort of update. It will not install because it wants you to insert the disk. If you click cancel it still tries to