cancel
Showing results for 
Search instead for 
Did you mean: 

File to IDoc Mapping Issue

Former Member
0 Kudos

Hello Folks,

Please find my input/output structures...It has 1 header and multiple Items. and I dont get any key field on Item values.

How can I achieve the target structure as below; Please guide me!

Input Structure: ( file)

AAA,BBB,CCC (Header Details)

123,456,789 (Item Details)

456,789,123 (Item Details)

789,123,456  (Item Details)

Output Structure:

ITEM    ---0 to Unbounded

ITEM_GROUP ---0 to Unbounded

          NAME:AAA

          VALUE 123

           NAME:BBB

          VALUE 456

          NAME:BBB

          VALUE 789 . ( for 1st line Item details as first Item group)

          NAME:AAA

          VALUE 456

           NAME:BBB

          VALUE 789

          NAME:BBB

          VALUE 123 .( for 2nd line Item details as 2nd Item group)

        

           NAME:AAA

          VALUE 789

           NAME:BBB

          VALUE 123

          NAME:BBB

          VALUE 123 .( for 1st 3rd Item details as 3rd Item group)

Accepted Solutions (1)

Accepted Solutions (1)

former_member184720
Active Contributor
0 Kudos

Duplicate ITEM_GROUP target node three times. (Right click on ITEM_GROUP node and select duplicate sub tree)

For the second and third duplicated nodes, instead of A, choose B&C ( as per my structure)

Former Member
0 Kudos

Thanks for the quick reply Hareesh....Sorry I forgot to mention, we can have "n" number of Item lines in a file.

former_member184720
Active Contributor
0 Kudos

It doesn't matter how many line item's(item details) you have..it depends on how many "VALUE" that you got under item details.

As you have VALUE's above, you duplicated the structure thrice.


I don't think number of VALUE's can be dynamic.. if so you can't handle it in content conversion itself.

Former Member
0 Kudos

exactly...we can't handle that in content conversion ( since we dont have a key value).

For that reason...I red every line as as one Item line. Is there any way to find out the context and based on that we need to map the details to the target structure;

For example, if the context 1 then we need to populate the values to Name properties and if its not we need to populate the values to Value(Item) properties, which is unbounded.

Testing:

Input file: ( in this example we have 5 Items/columns, we may have n number columns)

Item1,Item2,Item3,Item4,Item5 .....ItemN( Name properties)

AolarBan1,BolarBan2,ColarBan3,AolarBan1,BolarBan2......ItemN (Value properties, which is unbounded...in this case we have 2)

AolarBan1,BolarBan2,ColarBan3,AolarBan1,BolarBan2......ItemN

Desired Target Structure for the above file:

ITEM

      ITEM_GROUP

          NAME:item1

           VALUE: AoloarBan1

              

          NAME: Item2

          VALUE:BoloarBan1     ......and so on for the first record in the file





Note: For the above file, we need to generate Two Item segments ( as many as Item values from input file)


Please help me out!

Former Member
0 Kudos

Any updates for me?

former_member184720
Active Contributor
0 Kudos

You have to write UDF's.. Check below screenshot's and see if that works..

Former Member
0 Kudos

Thanks Hareesh...we are very close to the requirement.

for the above sample file which you provided....For example, if the input file has 4 line items, we need to generate 3 ITEM segments and underneath we need to provide the 3 line Item details with Name and value properties. and Name properties we need to capture from the 1st record in the file ( AAA,BBB,CCC).

sample file:

AAA,BBB,CCC

123,456,789

456,789,123

789,123,456

Target Structure:

ITEM   ---1

ITEM_Group

      Name AAA

      Value   123

ITEM_Group   

       Name BBB

      Value   456

ITEM_Group 

      Name CCC

      Value   789

ITEM   ---2

ITEM_Group

      Name AAA

      Value   456

ITEM_Group   

       Name BBB

      Value   789

ITEM_Group 

      Name CCC

      Value   123

ITEM   ---3

ITEM_Group

      Name AAA

      Value   789

ITEM_Group   

       Name BBB

      Value   123

ITEM_Group 

      Name CCC

      Value   456

-Stallin

former_member184720
Active Contributor
0 Kudos

copy nodeUDF and then add result.addContextChange  after second forloop.

use this UDF to map it to item_group.

Former Member
0 Kudos

Thanks a ton Hareesh.

Answers (0)