cancel
Showing results for 
Search instead for 
Did you mean: 

Sender file conversion

Former Member
0 Kudos

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

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

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

Former Member
0 Kudos

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

Former Member
0 Kudos

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

Former Member
0 Kudos

But aaa has nothing to do with the keyFieldvalue. Thats just some data. The real key field value is 10 for header, 20 for item and 99 for trailer.

/Jakob