cancel
Showing results for 
Search instead for 
Did you mean: 

Loop in message mapping

Former Member
0 Kudos

Hi all,

I have a requirement and have been breaking my head on this .

Source Target

PO1 - 0 to 999999 Idoc Segment(E1EDK2)

Item No(field)

SCH 0 to 999999 (Node)

Here I have a Parent node PO1 which needs to be looped

and within that I have SCH segemet which gets repeated

the requirement is first I need to check the if the values in the SCH exist , If it exist then I need to take the two values from SCH and item number from PO1 segment an create a traget segment. If the SCH does not exist then i need to take the item level values and create a segment. The challenge here is, I have a loop within a loop and the target segment is only one.

Kindly help me with this scenario.

Regards

Venu

Accepted Solutions (0)

Answers (1)

Answers (1)

MichalKrawczyk
Active Contributor
0 Kudos

hi,

this is possible

which sp are you running on?

if you can define global variables

you can define global arrays in which you'll store the results

then you need to put all values in one advanced function

and put them in map for example and do the looping

in your java function (with all values at once)

then put the result in the global array

from which you can take it out in any other function

(for all the rest of the tags)

but I don't know about the performance of this ...

maybe you can do the same in java mapping?

but I'm sure it can be done in message mapping too

Regards,

michal

Former Member
0 Kudos

Can anybody tell me how can we do without defining user defined functions.

MichalKrawczyk
Active Contributor
0 Kudos

hi,

it's impossible to do a loop without user function

in message mapping

use the user define function or java mapping

Regards,

michal

-


<a href="/people/michal.krawczyk2/blog/2005/06/28/xipi-faq-frequently-asked-questions"><b>XI / PI FAQ - Frequently Asked Questions</b></a>

moorthy
Active Contributor
0 Kudos

Create a small user defined function to achieve this.

Without that I don;t think so it is possible..

Also you can go with java mapping

Regards,

Moorthy

MichalKrawczyk
Active Contributor
0 Kudos

hi Moorthy,

if small = simple

it will not do as you won't get the whole array

in a simple function (so no loop right?)

he needs to use either advanced user function

of java mapping

anyway it's is possible with advanced user function

Regards,

michal

Former Member
0 Kudos

how will we loop at the segment ?? in java code..

how to find the total number of records(COUNT) in that SEGMENT??

if i know that number ... I'll use the for loop..

please tell me how to find out the count value of the sengment....

Thanks

sagar

Message was edited by: sagarkavi srungarakavi

Message was edited by: sagarkavi srungarakavi