Skip to Content
author's profile photo Former Member
Former Member

How to separate a substructure without Key Fields

Hi,

Could someone help me about my problem regarding subtructures without key fields.

The file looks something like below:

"DEL_NO","HDR4","DSI","ROUTE"

"0034194465","ARC018114o Drop 1","20/09 @ 11:00","Y10022"

"0034194825","ARC018114o Drop 2","20/09 @ 11:00","Y10022"

The RecordSet is HEADER,1,LINE_ITEM,*

I can identify the header because the file will always contain "DEL_NO" as its first field, so I can set it as my HEADER.keyFieldValue. As for the LINE_ITEM, the first field will most probably change its values. How will I separate the header from the line item if the LINE_ITEM substructure does not have a key? Is there a possible way to do this? Could you provide a sample code...

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

1 Answer

  • author's profile photo Former Member
    Former Member
    Posted on Jan 31, 2008 at 07:49 AM

    There is one workaround .....

    If your incoming file does not have a Key value field for the Line item ,then you can create an intermediate structure of the form

    Header

    <fields>

    LineItem

    <fields>

    Then at the file adapter level you would be reading every line at the record form ie

    LineItem

    <fields>

    so even the header will be read as a Lineitem the first time.This structure should be converted to the intermediate structure before mapping to the original structure

    So,

    your file structure -> interm structure - > inb interface structure

    In case you are not clear do let me know.

    Regards

    Priyanka

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member Former Member

      I shall give you an example

      Suppose your outbound structure is

      Record_DT

      Item

      field 1

      field 2

      field n

      Then in the Communication channel you will read as

      Item,* with the field names - field 1,field 2 ...field n

      Next you need to create an intermediate data type

      Interm_DT

      Header

      header field 1

      header field 2

      ...header field n

      Item

      field 1

      field 2

      field n

      Then there would be an extra mapping which will convert your outbound structure to the intermendiate structure.

      Regards

      Priyanka

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.