cancel
Showing results for 
Search instead for 
Did you mean: 

Mapping: each header with each line item

Former Member
0 Kudos

Hi,

I am working in a Idoc to File(FCC) scenario. I have a requirement where the target file should be generated in such a way that my target csv file should be generated like

header1-item1

header1-item2

header1-item3

header2-item1

header2-item2

header3-item3 and so on...

how can this requirement be achieved?? should it be done in mapping or FCC??

Regards,

Deepika

Accepted Solutions (0)

Answers (3)

Answers (3)

samiullah_qureshi
Active Contributor
0 Kudos

Hello Deepika,

I think you have to use both mapping and FCC to achieve this.

First of all, you should have a structure to comply your requirement. For Example: if your header is having 2 fields and your item is having 3 fields then you can use following sample structure as target structure:

<Data> Occurence 0..Unbounded

<HeaderField1>xyz</HeaderField1> Occurence 0..1(as u want)

<HeaderField2>xyz</HeaderField2> Occurence 0..1(as u want)

<ItemField1>abc</ItemField1> Occurence 0..1(as u want)

<ItemField2>abc</ItemField2> Occurence 0..1(as u want)

<ItemField3>abc</ItemField3> Occurence 0..1(as u want)

</Data>

In mapping, you can map the Data node with the Item node in source message. So there will be as many Data node as of your Item node in ur source message. U can map the item fields under item node to ItemFields in Data node.

For HeaderFields in Data node, you have to validate that which Header field belongs to which Item Field. Based on this validation pass the values to HeaderFields in target.

In receiver file adapter, you can use FCC to create the a CSV line for each occurence of Data node.

Regards,

Sami.

Former Member
0 Kudos

Hi,

My source Idoc is desadv.delvry03 and target structure is like this

<MT_DI>

<Record>

<Header>

field1

field2

<Item>

<Field1>

the header and item are in the same level. should I be changing the target structure? if so, kindly tell me how should it be and how I can achive my requirment

Regards,

Deepika

Former Member
0 Kudos

Hi,

U can do modification in ur target structure.

Root - 0-Unbounded

Detail - 0-1

U can concate header field with each item and then map it to target detail node which will be treated as single record which will have both header as well as item detail

in this case ur FCC will become simple of single field.

chirag

Former Member
0 Kudos

Hi Sami,

What if I want the header and line item data to be in different lines. if I use the approch that you told, both my header and item data will appear in the same line. if i want line item below the header line how will this be achieved

Regards

Deepika

Former Member
0 Kudos

It should be handled in mapping.

What is the Idoc type you are using? Do you receive multiple header segments in same Idoc? Then there should be field at item level to identify the corresponsing header segment.

If this is not the case, then you can copy header (copy value) for each item record and use the append mode in target file adapter to create the file as you mentioned (Assumption here is each Idoc contains 1 header and multiple lien items).

Former Member
0 Kudos

Hi,

I might have multiple headers. but under each header I will have multiple items, and the header has to repeat for the line items under that perticular header. can you suggest how can i achieve this

Regards,

Deepika

Former Member
0 Kudos

did u try my approach???

Former Member
0 Kudos

Hi,

I tried a similar approch. I changed my target structure and put item node inside the header node segment. Now my requirment is satisfied. but I am getting the field values of item and header in the same level. how do I put header values and item field values in 2 different lines

Regards,

Deepika

Former Member
0 Kudos

chk this:

/people/shabarish.vijayakumar/blog/2010/01/14/file-conversion-using-nodeception

Former Member
0 Kudos

Hi,

mu requirement is different. I want each header to be repeated for each item.

Regards,

deepika