on 05-17-2007 9:06 PM
Hi,
In the Shabarish Vijayakumar's weblog
/people/shabarish.vijayakumar/blog/2005/08/03/xpath-to-show-the-path-multiple-receivers
1. I need code for the following UDFs
ChkSum and AnyError
and
2. how Constant (RDFILE) can be created ?
Thanks,
ss
Message was edited by:
s s
<b>For chkSum - </b>
Create a UDF [Enhanced Functions (Cache = Context)]
int totAmount=0;
for(int j=0;j<a.length;j++)
{
totAmount=totAmount+Integer.parseInt(a[j]);
}
if(totAmount==Integer.parseInt(b[0]))
result.addValue("0");
else
result.addValue("1");
<b>For AnyError - </b>
Create a simple function
if(a.equals("true") && b.equals("0"))
return "0";
else
return "1";
<i>2. how Constant (RDFILE) can be created ?</i>
>>>
in the Filename give the value as RDFILE
else if u r askin how to create a constant in the mapping logic use the constant function from the standard functions available (http://help.sap.com/saphelp_nw04/helpdata/en/43/c4cdfc334824478090739c04c4a249/content.htm)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
hi
You can create constant RDFILE in this way
in functions( below left ) go to constants and select constant
double click it and set the value as RDFILE
Mudit
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Mudit,
I tried the code as advanced UDF but it gave me
<b><u>Source code has syntax error:</u></b>
C:/usr/sap/SXI/DVEBMGS01/j2ee/cluster/server0/./temp/classpath_resolver/Mapfc96f4b0a30f11dba64f001676478b29/source/com/sap/xi/tf/_RD_MM_.java:86: cannot resolve symbol symbol : variable amount location: class com.sap.xi.tf._RD_MM_ for(int i=0;i<amount.length;i++) ^
C:/usr/sap/SXI/DVEBMGS01/j2ee/cluster/server0/./temp/classpath_resolver/Mapfc96f4b0a30f11dba64f001676478b29/source/com/sap/xi/tf/_RD_MM_.java:88: cannot resolve symbol symbol : variable amount location: class com.sap.xi.tf._RD_MM_ totAmount=totAmount+Integer.parseInt(amount); ^
C:/usr/sap/SXI/DVEBMGS01/j2ee/cluster/server0/./temp/classpath_resolver/Mapfc96f4b0a30f11dba64f001676478b29/source/com/sap/xi/tf/_RD_MM_.java:90: cannot resolve symbol symbol : variable sum location: class com.sap.xi.tf._RD_MM_ if(totAmount==Integer.parseInt(sum[0])) ^
C:/usr/sap/SXI/DVEBMGS01/j2ee/cluster/server0/./temp/classpath_resolver/Mapfc96f4b0a30f11dba64f001676478b29/source/com/sap/xi/tf/_RD_MM_.java:97: cannot resolve symbol symbol : variable Input1 location: class com.sap.xi.tf._RD_MM_ if(Input1.equals("true") && Input2.equals("0")) ^
C:/usr/sap/SXI/DVEBMGS01/j2ee/cluster/server0/./temp/classpath_resolver/Mapfc96f4b0a30f11dba64f001676478b29/source/com/sap/xi/tf/_RD_MM_.java:97: cannot resolve symbol symbol : variable Input2 location: class com.sap.xi.tf._RD_MM_ if(Input1.equals("true") && Input2.equals("0")) ^
C:/usr/sap/SXI/DVEBMGS01/j2ee/cluster/server0/./temp/classpath_resolver/Mapfc96f4b0a30f11dba64f001676478b29/source/com/sap/xi/tf/_RD_MM_.java:98: cannot return a value from method whose result type is void return "0"; ^
C:/usr/sap/SXI/DVEBMGS01/j2ee/cluster/server0/./temp/classpath_resolver/Mapfc96f4b0a30f11dba64f001676478b29/source/com/sap/xi/tf/_RD_MM_.java:100: cannot return a value from method whose result type is void return "1";
what went wrong ?
Thanks,ss
Hi
AnyError
if(Input1.equals("true") && Input2.equals("0"))
return "0";
else
return "1";
Mudit
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi;
Code for ChkSum
int totAmount=0;
for(int i=0;i<amount.length;i++)
{
totAmount=totAmount+Integer.parseInt(amount<i>);
}
if(totAmount==Integer.parseInt(sum[0]))
result.addValue("0");
else
result.addValue("1");
Mudit
Award Points if it helps
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
93 | |
10 | |
10 | |
9 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.