on 12-01-2005 12:20 PM
Hi,
I need to convert a flat file to XML. The problem is that the key field is NOT the first field. It´s the second...
Suppose the file is as follows:
000000010aaaaa
000000120bbbbb111
000000220ccccc111
000000320ddddd111
999999999xxxxx
The first 7 is a kind of a line-numbering. The structure type is defined in position 8-9 (10 = header, 20 0 item and 99 = end)
How do i set up the keyFieldValue??
Regards
Jakob Steen-Petersen
Hi Steen,
you would need to specify the name of your key field, xml.keyFieldName, here you can specify the name
and in xml.keyFieldValue, you can give the value "aaa..." or "bb.." etc
you would also give the xml.fieldNames & xml.fieldFixedLengths where u specify the order of your fields
Hope this helps
Regards
Vishnu
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
I don´t understand. If i set up as showed below how does the adapter knows that the keyfield value are found in position 8-9 and not in position 6-7???
head.keyFieldValue 10
head.fieldNames line,type,data
pos.fieldFixedLengths 7,2,116
pos.keyFieldValue 20
pos.fieldNames line,type,data
end.fieldFixedLengths 7,2,116
end.keyFieldValue 99
end.fieldNames line,type,data
/Jakob
Hi Steen,
it has to be as below (this is for Standalone J2SE adapter), you can do similar conversion if u use central adapter engine (with module MessageTransformBean & ModuleKey XML2Plain)
check this link as well (for conversion)
http://help.sap.com/saphelp_nw04/helpdata/en/0b/9a50465ccf84479e39a6d50c90fb3f/frameset.htm
xml.recordsetsPerMessage=*
xml.documentName=mydocumentname
xml.recordsetStructure=myheader,,mybody,,myfooter
xml.keyFieldName=mykeyfield
xml.keyFieldType=CaseSensitiveString
xml.recordsetName=anything
xml.recordsetStructureOrder=var
xml.lastFieldsOptional=YES
(this part has to repeat for all the groups, header, body, footer)
xml.myheader.structureTitle=titletocomeinxml
xml.myheader.keyFieldValue=10
xml.myheader.fieldNames=mysevendigitfield,mykeyfield,anotherfield,someotherfield
xml.myheader.fieldFixedLengths=7,2,8,8
Hope this fixes your issue
Regards
Vishnu
User | Count |
---|---|
93 | |
10 | |
10 | |
9 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.