cancel
Showing results for 
Search instead for 
Did you mean: 

Complex Message Mapping

Naama
Participant
0 Kudos

Hi all,

I need to map an item node that can apper severl times (in IDOC) to one row in the target MT,

every 3 items i need to map to one row in the taget - one item after the other in the tagert (concatenat 3 items)

my Itam row in the target looks like this:

some fileds, item1item2item3, some fileds

some fileds, item4item5item6, some fileds

and so on........

Thanks,

Naama

Accepted Solutions (0)

Answers (3)

Answers (3)

Former Member
0 Kudos

Hi Naama,

Your requirement and the source data format is not very clear. If you could provide with more information about the source IDoc structure and the exact functional mapping requirement, that would help us to answer your query. But just as the initial understanding goes - using a UDF seems to be the best option.

Regards,

Suddha

Naama
Participant
0 Kudos

Hi,

I will try and explain my problem,

my source structure is ORDERS05 IDOC,

in the idoc there is a segment E1EDP01 which occurs * times,

this segment I need to map to the target structure in this way:

every 3 E1EDP01 in need to transfer to one target item (concatenate 3 items to one)

I hope this is more clear now,

Thanks

Naama.

Former Member
0 Kudos

You can achieve this by using UDF i guess. Like pass the queue of Items as a parameter to function.

Then try this

int j=1;

String b = null;

for ( i=0;i<a.length;i++)

{

if(j<=3)

{

b = b+a<i>;

j=j+1;

}

else if (J>3)

{

b = b+"~";

j=1;

}

}

result.addValue(" " );

Then split the b using ~, store it in an array . then retrieve this array value, save it in global container variables / global variables then map it to ur target .

I am sure you need to modify this code. Just the idea

Former Member
0 Kudos

Dear Neema,

Try this way

1. In the Message Mapping get all the Item fields in to Mapping area.

2. Also get the target field.

3. Concatinate the first two using one String Concat function

4 use this result as input to second Concat function giving second operand as third item field.

5. give this resultant to the target field

If not Use XSLT Mapping Using ALTOVA Mapforce

there you got many such options to play with Message Mapping.

Best Regards

Praveen

Naama
Participant
0 Kudos

I dont know how many Items i will get from the source idoc,

How do I get 3 items at a time?

Former Member
0 Kudos

Dear Nemma,

If that is the case use Java Mapping,

where in use a for loop or while loop to collect all your Item details and then concatinate 3 items, send them to target field.

Best Regards

Praveen

Former Member
0 Kudos

Hi,

if you get always exactly three items in one context you could use a UDF of type context and concat the values there.

Otherwise please give a little more detail of your source structure.

Regards

Patrick