cancel
Showing results for 
Search instead for 
Did you mean: 

Variables in target mapping

former_member187587
Contributor
0 Kudos

Can Variables in target mapping can be used in the deefinition of another target field.

for example:

target variable - *var1(with initialized value )

target variable - *var1 ->substring(0,3) -> *var2

cheers.

Nimrod.g

Accepted Solutions (0)

Answers (7)

Answers (7)

GabrielSagaya
Active Contributor
0 Kudos

If you are using PI 7.0, then you can use UDF to achieve this.

function myudf(String a,String b,Container container)

{

String b = "";

//Modify the contents of a.

b = a.substring(0,3);

if (b=="1")

return a;

if (b=="2")

return b;

}

a---> MyUdf-->var1

b(1)--

a---> MyUdf-->var2

b(2)--

former_member187587
Contributor
0 Kudos

thanks Gabriel but I'm trying to figure out the usage limitations with this feature in PI 7.1.

Later I'll found work around.

thanks for the effort though

Nimrod

former_member184619
Active Contributor
0 Kudos
former_member187587
Contributor
0 Kudos

Dear Sachin,

I'm familiar with this document.

but it has no clue regarding my proplem.

former_member184619
Active Contributor
0 Kudos

Hi,

Check page no. 8, Where it talks about Graphical variables which can store an intermidiate result in message mapping... I think this should help.

Sachin

former_member187587
Contributor
0 Kudos

see my original post Sachin.

even a simple test like that failed.

former_member187587
Contributor
0 Kudos

Opened product error for SAP.

if you experiance the same problem still let me know.

thank you all for the effort.

SudhirT
Active Contributor
0 Kudos

Hi Nimrod,

You can achieve this either by using same mapping logic + substring function to use first target value for the second target.

Or

You can make use of Edit Java Section, there you can store the output of first target in a variable and then can reuse that according to your requirement.

Check Edit Java Section in

http://help.sap.com/saphelp_nw04/helpdata/en/ee/bf9640dc522f28e10000000a1550b0/frameset.htm

Thanks!

former_member187587
Contributor
0 Kudos

Hi all,

We are using the SAP PI 7.1 SP6.

I'm trying to avoid running the same mapping (especially when using lookups) to

hold the value as a variable.

problem happened when I use one variable (with substring for example)to help define another variable.

If you have experienced this specific behavior or created a small test and faced the same problems your solution will be most welcome.

Nimrod.g

Former Member
0 Kudos

Hi...

Check the below link.

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

Regards,

Leela

samiullah_qureshi
Active Contributor
0 Kudos

Hi,

Go through following link, explaining how to use variables in message mapping to avoid redundant mapping: -

http://help.sap.com/saphelp_nwpi71/helpdata/en/1d/1140dc082d4c009580100d7efc544a/frameset.htm

Regards,

Sami

former_member214364
Active Contributor
0 Kudos

Hi Nimrod,

Which version of PI you are using? In PI7.1 had this option in Graphical message mapping.

http://help.sap.com/saphelp_nwpi711/helpdata/en/61/8c3842bb58f83ae10000000a1550b0/frameset.htm

Cheers,

Jag

prateek
Active Contributor
0 Kudos

Use global variable for such operations. If you are using PI 7.1, then you may use "Add Variable" option for storing intermediate mapping results.

Regards,

Prateek