on 03-24-2009 12:01 PM
Hi, I have created a user defined function in message mapping and it works fine as it is but now the customer wants to changes something and I don't know how to implement it.
My current code which works:
String INVTnegCT="1";
String INVTposCT="2";
if (a.equals("INVTnegCT")
{
return INVTnegCT;
}
else {
return "INVTposCT";
}
But they want me to change neg/pos to -/+ for example INVTposCT to INVTCT but it seems that I can't use -/ in the function. is there a way to do it?
thanks for response!
No we cannot. It's a violation of language constructs.
But I am wondering what is the necessity of defining variable like that as you are returning their value not the variable name itself.
I think may be they are asking you for this
String INVTnegCT="INVT-CT";//modified here
String INVTposCT="INVT+CT";//modified here
if (a.equals("INVTnegCT")
{
return INVTnegCT;
}
else {
return "INVTposCT";
}
Edited by: Praveen Gujjeti on Mar 24, 2009 5:39 PM
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
then this code will work.
String INVTnegCT="1";
String INVTposCT="2";
if (a.equals("INVT-CT")
{
return INVTnegCT;
}
else {
return INVTposCT;
}
input will be from source structure field and that is variable a in UDF. It can have values INVT-CT (or) INVT+CT.
Edited by: Praveen Gujjeti on Mar 24, 2009 5:51 PM
Hi,
use graphical mapping for this case..........take your input node, take a constant INVT-CT and use Text standard function equalS and then take this output to Boolean if function........then in then have a constant 1 and in else have 2.........
or if you want to use UDF only then:
String INVTnegCT="1";
String INVTposCT="2";
if (a.equals("INVT-CT")
{
return INVTnegCT;
}
else {
return "INVTposCT";
}
Regards,
Rajeev Gupta
Hi
Do you need to pass either of INVT-CT or INVT+CT as return value.
If it is so, please check the below code.
String strneg ="INVT-CT";
String strpos ="INVT+CT";
if(a.equals("INVTnegCT")
{
return strneg;
}
else {
return strpos;
}
Thanks
Prasad Nemalikanti
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
do onething
declare and assign string pos = "+" and neg ="-"
then return these strings based on the logic you write instead of earlier things
otherwise concat strings with needed fied andsend the response
if not clear for you post the exact req in detail
Rajesh
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
101 | |
13 | |
13 | |
11 | |
11 | |
7 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.