cancel
Showing results for 
Search instead for 
Did you mean: 

How to separate a substructure without Key Fields

Former Member
0 Kudos

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...

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

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

Former Member
0 Kudos

Thanks for the suggestion but I'm kinda confused with what you're saying... sorry I'm new to XI.

What do you mean by creating an Intermediate structure of the form? Is it the one below?

For the code below... I made "0034194465" as the key field... but this will not do because only the row with 0034194465 will be taken into account.

- <RECORD>

- <HEADER>

<DELNUM>DEL_NO</DELNUM>

<HDNO4>HDR4</HDNO4>

<SHIPINST>DSI</SHIPINST>

<ROUTE>ROUTE</ROUTE>

</HEADER>

- <LINE_ITEM>

<DELNUM>0034194465</DELNUM>

<HDNO4>ARC018114o Drop 1</HDNO4>

<SHIPINST>20/09 @ 11:00</SHIPINST>

<ROUTE>Y10022</ROUTE>

</LINE_ITEM>

</RECORD>

Former Member
0 Kudos

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