cancel
Showing results for 
Search instead for 
Did you mean: 

Sender Content Conversion - Deep Structure Question

Former Member
0 Kudos

Hello!

I receive a file that has the following format:

HEADER  (occurrence = 1)
INVOICES (occurrence = n)
     HEAD     (occurrence = 1)
     DETAIL   (occurrence = n)
TRAILER (occurrence = 1)

The file looks something like this:

1Field1Field2...Fieldn

2Field1Field2...Fieldn

3Field1Field2...Fieldn

3Field1Field2...Fieldn

:

:

3Field1Field2...Fieldn

2Field1Field2...Fieldn

3Field1Field2...Fieldn

3Field1Field2...Fieldn

:

:

3Field1Field2...Fieldn

4Field1

Where 1 is the keyfieldvalue for Header, 2 for the Invoice Header, 3 for the Invoice Detail and 4 for the Trailer.

Is it possible to manage this kind of file using the File Content Conversion. I'm haven't been able to get it to work. I don't wan't to split the file into separate msgs so I'm not using the option Recordsets per message.

I'll greatly appreciate any help, suggestions.

Kind Regards,

Carlos López

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

use this:

1Field1Field2...Fieldn

2Field1Field2...Fieldn

3Field1Field2...Fieldn

3Field1Field2...Fieldn

FCC:-

1(Header),1,2,(),3,(),Trailer,*,

chirag

PS: * is not displayed correctly

Edited by: Chirag Gohil on Feb 22, 2009 4:39 PM

Answers (4)

Answers (4)

Former Member
0 Kudos

Thank you all for you time and help!! I was able to solve the problem by following chirag's suggestion.

I defined my message to have this format:

<MESSAGE>
  <RECORD>  (1...unbounded)
     <HEADER> (0...1)
     <INVOICE_HEADER> (1)
     <INVOICE_DETAIL> (1...unbounded)
     <TRAILER> (0...1)
  </RECORD>
</MESSAGE>

And the Recordset Structure:
HEADER,1,INVOICE_HEAD,1,INVOICE_DETAIL,*,TRAILER,*

so that the trailer is optional (thank's Koen)

Thanks again!!

Kind Regards,

Carlos López Hernández

Former Member
0 Kudos

Hi Peter:

Just tried, but still getting the same error.

Kind Regards,

Carlos López Hernández

Former Member
0 Kudos

Hi Carlos,

then I am afraid that the means of the file conversion of the file adapter are exhausted. Could you consider a Java mapping as an alternative?

Regards,

Peter

Former Member
0 Kudos

Carlos,

You could try with recordset structure

HEADER,*,INVOICE_HEADER,1,INVOICE_DETAIL,*,TRAILER,1,

so that the header is optional.

Kind regards,

Koen

Former Member
0 Kudos

Thank you all for your replies.

Ramkiran, I tried your suggestion but I still get an error:

Conversion of file content to XML failed at position 0: java.lang.Exception: ERROR consistency check in recordset structure validation (line no. 5: missing structure(s) before type 'INVOICE_HEADER'

It seems as if it was expecting a file with the following structure:

HEADER

INVOICE_HEADER1

INVOICE_HEADER2

:

INVOICE_HEADERn

INVOICE_DETAIL1

INVOICE_DETAIL2

INVOICE_DETAILn

TRAILER

Instead of:

HEADER

INVOICE_HEADER1

INVOICE_DETAIL1_1

INVOICE_DETAIL1_2

INVOICE_HEADER2

INVOICE_DETAIL2_1

INVOICE_DETAIL2_2

:

INVOICE_DETAIL2_n

:

INVOICE_HEADERn

INVOICE_DETAILn_1

INVOICE_DETAILn_2

:

INVOICE_DETAILn_n

TRAILER

This is how my input file looks like: (line 5 is in BOLD):

A9166407 <---HEADER

11231200 <----INVOICE_HEADER1

20014014 <----INVOICE_DETAIL1_1

200231 <----INVOICE_DETAIL1_2

11231200 <----INVOICE_HEADER2

20014014 <----INVOICE_DETAIL2_1

20025077 <----INVOICE_DETAIL2_2

20014014 <----INVOICE_DETAIL2_3

20025077 <----INVOICE_DETAIL2_4

99999999 <----TRAILER

It's complaining about line 5 which is the Second Invoice Header.

I defined the Recordset Structure like this:

HEADER,1,INVOICE_HEADER,*,INVOICE_DETAIL,*,TRAILER,1

Kind Regards,

Carlos López Hernández

Edited by: Carlos Lopez Hernandez on Feb 23, 2009 2:26 PM

Edited by: Carlos Lopez Hernandez on Feb 23, 2009 2:32 PM

Former Member
0 Kudos

Hi Carlos,

did you try with parameter ignoreRecordsetName = false?

Kind regards,

Peter

Former Member
0 Kudos

Hi Carlos,

You can create your structure specified below

HEADER ......(1...1)

Invoice_Header(0....*)

Invoice_Detail(0......*)

TRAILER ......(1.....1)

and spceify your parameters as

HEADER.fieldNames,

HEADER.keyFIeldValue,

HEADER.fieldFixedLengths

Invoice_Header.fieldNames,

Invoice_Header.keyFieldValue,

Invoice_Header.fieldFixedLengths,

Invoice_Detail.fieldNames,

Invoice_Detail.keyFieldValue,

Invoice_Detail.fieldFixedLengths,

TRAILER.fieldNames,

TRAILER.keyFIeldValue,

TRAILER.fieldFixedLengths

This will work.

Thanks,

Ramkiran.K