cancel
Showing results for 
Search instead for 
Did you mean: 

How to use Variable in message mapping

Former Member
0 Kudos

Hi Experts,

I have some problem using variable in message mapping.

In one message mapping, since a block of logic is repeated for several fields, then i tried to use a variable instead.

the repeated logic is: first if condition, then use a udf to form a queue which will be suppressed by its father node.

i tried to assign the result queue to a variable after the UDF execution. (this variable is created after the father node)

I am wondering is there any restriction of using variable?

Can we assign the whole queue to a variable?

Can we use UDF during the process of assigning value to variable?

thanks in advance.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi,

No, You can not assign the queue to a variable. The occurence of the variable is 0..1.

Thanks,

Sidhartha

Answers (2)

Answers (2)

former_member193376
Active Contributor
0 Kudos

I dont think you can assign a queue to a variable,I am not 100% sure, . and there is no restriction to useing a Zvariable, only u can use it after you declare at some parent level.

Yes you can use a UDF in the process of assigning to a Zvariable.

Check out this link and read the comments of the blog.

SAP PI 7.1 Mapping Enhancements Series: Using Graphical Variable

/people/william.li/blog/2008/02/13/sap-pi-71-mapping-enhancements-series-using-graphical-variable

Edited by: Saiyog Gonsalves on Nov 6, 2010 6:40 PM

anupam_ghosh2
Active Contributor
0 Kudos

Hi Aditya,

Can you please explain the input and expected output of your mapping with some example.

Regards

Anupam

Former Member
0 Kudos

let me give an example, please focus on the variable assignment.

If ifWithOutElse, then give value "true", keep suppress value. then using a UDF to form the queue to another specified queue which i wanted. after that i need to assign the result queue to a variable since it would be used several times.

i tried to use a variable but failed, i want to know the limitation of using a variable.

could anyone help on this?

Edited by: Aditya Mutyala on Nov 8, 2010 10:26 AM