cancel
Showing results for 
Search instead for 
Did you mean: 

Copy the target value to another target value

Former Member
0 Kudos

quick help!

Basically I would like to copy one Target field1 value to another Target field2 value.. BTW, Field1 value is not mapped from Source, it is derived from some function..

And also I can't copy the function directly to two target values as there are looping in the function.

Please advise

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Still do not understand why you can not map to two target field just because looping in function.

Anyway, except the proposal in above replies, you can also add another message mapping in operation mapping:

both source and target message are same as your current target message, then you can map Field 1 from source to Field 2 of your target.

Regards

Liang

Answers (1)

Answers (1)

Former Member
0 Kudos

Hello,

You can use global variables that in runtime time it work because this value is on cache.

For review

http://help.sap.com/saphelp_nw04/helpdata/en/e0/7d8e40496f6f1de10000000a1550b0/frameset.htm

First you have to save your value (Field1): (this you should put after you get the value in the function)

public String setVar(String varName,String varValue,Container container){

GlobalContainer gc = container.getGlobalContainer();

gc.setParameter(varName, varValue);

return varValue;

}

Then in the Field2 return that value:

public String getVar(String pVarName,Container container){

GlobalContainer gc = container.getGlobalContainer();

String output = "";

if(gc.getParameter(pVarName) != null)

output = String.valueOf(gc.getParameter(pVarName));

return output;

}

regards,

lpbuff

Former Member
0 Kudos

If copy this code - would this work in UDF? or should i do some changes on it? pls help

Thanks

Former Member
0 Kudos

Hi.

You should be create two UDF one to saved the value and anoother to get the value an populated in differente target.

One more question if you used PI 7.1 i . You can map to constant value.

Former Member
0 Kudos

This message was moderated.