cancel
Showing results for 
Search instead for 
Did you mean: 

Strange Fix length File

Former Member
0 Kudos

Hi All,

I have a txt file which contains so many records in the same row..

we have a 10 spaces after every record in the same row.

but here for convenice i have taken only two records.

forexample

01abcind 05123MCA

Here my doubt is how to convert this one row file which contains so many different records into XML by using content conversion.

here i am providing content conversion parameter for J2SE.

but i am getting only one record in XML (Moni)

<b>mode=FILE2XMBWITHSTRUCTURECONVERSION

XI.SenderService=BS_IMS

XI.Interface=MI_IMS

XI.InterfaceNamespace=http://www.sap.com/xi/abc

xml.documentName=MT_IMS

xml.documentNamespace=http://www.sap-press.com/xi/training/00

xml.recordsetName=RECORDSET

xml.recordsetStructure=RECORD00,1,RECORD05,*

xml.keyFieldType=CaseSensitiveString

xml.keyFieldName=RECORDTYPE

xml.RECORD00.fieldNames=ID,NAME,ADDRESS

xml.RECORD00.keyFieldValue=00

xml.RECORD00.fieldFixedLengths=2,3,3

xml.RECORD05.fieldNames=ID,HEIGHT,QUAL

xml.RECORD05.keyFieldValue=05

xml.RECORD05.fieldFixedLengths=2,3,3

xml.RECORD0o.endSeparator=</b>

please help me ...

Regards,

Reehan

Accepted Solutions (0)

Answers (3)

Answers (3)

Shabarish_Nair
Active Contributor
0 Kudos

try,

xml.documentName=MT_IMS

xml.documentNamespace=http://www.sap-press.com/xi/training/00

xml.recordsetName=RECORDSET

xml.recordsetStructure=RECORD00,1,RECORD05,*

xml.recordsetsPerMessage = *

xml.keyFieldType=CaseSensitiveString

xml.keyFieldName=RECORDTYPE

xml.RECORD00.fieldNames=ID,NAME,ADDRESS

xml.RECORD00.keyFieldValue=00

xml.RECORD00.fieldFixedLengths=2,3,3

xml.RECORD00.endSeparator = <i> -> specify a space here</i>

xml.RECORD05.fieldNames=ID,HEIGHT,QUAL

xml.RECORD05.keyFieldValue=05

xml.RECORD05.fieldFixedLengths=2,3,3

xml.RECORD05.endSeparator = <i> -> specify a space here</i>

Former Member
0 Kudos

Hi Rehan,

for your this scenario, you can take the complete txt file into a single record in a XML file.......for this create a data type which will have only one field of string type..... then you will have to create a JAVA mapping program in which you will take this data as a string variable and you will create the target output msg by applying logic in your java mapping........then in interface mapping, take source msg interface and target msg interface and then in mapping program use this java mapping which you will import by imported archive option.

Thanks,

Rajeev Gupta

former_member184619
Active Contributor
0 Kudos

Hi Reehan,

Just check these links

/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/venkat.donela/blog/2005/06/08/how-to-send-a-flat-file-with-various-field-lengths-and-variable-substructures-to-xi-30

and this 1 might be helpful

/people/anish.abraham2/blog/2005/06/08/content-conversion-patternrandom-content-in-input-file

Sachin