cancel
Showing results for 
Search instead for 
Did you mean: 

Store Lookup results to a Global variable.

yeshuaq
Explorer
0 Kudos
277

Hi,

could you please suggest how to store lookup out put values to a global variable. (SAP PO75)

I have a target structure like shown below and i had created a variable (by Add variable option) under Messages level and i mapped with lookup output. display queue here shows all values of lookup output.

but when i try to map same variable in fields level, it is not fetching the values from global variable created at message level. So can please suggest how to assign lookup out to global variable and which level?

Thank you.

Messages

--Message1

----customersList

------Field1

------Field2

------Filed3

--Message2

----CustomerList2

------Field11

------Field22

------Filed33

--Message3

----CustomerList3

------Field111

------Field222

------Filed333

yeshuaq
Explorer
0 Kudos

Hi SAP PI/PO Experts,

Can you please suggest how to processed on this issue. is it a SAP Product issue/Bug? or mapping issue.

Regards,YQ

Accepted Solutions (0)

Answers (2)

Answers (2)

ravicarpenter
Active Participant
0 Kudos

Format by example requires no. of elements to be equal in both queues. I think global variable input queue might not be matching with your second queue. Check both queues in debug mode and if queues are unequal you'll have to implement some logic. Additionally, first check only with if-then, if works ok then gradually add formatbyexample.

ravicarpenter
Active Participant
0 Kudos
yeshuaq
Explorer
0 Kudos

Hi Ravi,

Thanks for the details shared. But in latest versions we have an option to define variable directly.

so can you please let me how to use that option and which level of my message mapping i have to call. i need those look up results to map with fields in CustomerList,CustomerList2,CustomerList3 segments.

i tried to add variable at Messages level and when i map that variable to target fields directly without any validation, then in output, the variable values were displaying in the fields that i mapped. BUT if i have any validation logic like IF-THEN, FORMAT BY EXAMPLE, then the output is not populating variable values. it shows error as'Function formatByExample: Queues do not have the same number of values'.

my mapping is like:

1.added variable at Messages level

2. mapped that variable to the /CustomerList/Field1

variable-->format by example-->IF/Then-->Field1

Best Regards,YQ