on 03-30-2009 8:06 PM
Hi,
Written a UDF to get a system details, iam getting the systemid with "System.getProperty"
Bases on the system id returned, i must pass the values.
By using the below UDF, iam getting error.
public String Get(Container container){
//write your code here
String sysName = (String) System.getProperty("SAPSYSTEMNAME");
if ( 'DEV' .equals(sysName) )
{
sysName = "DEVCLNT120";
}
elseif ( 'QA' .equals(sysName) )
{
sysName = "QACLNT120";
}
return sysName;
}
Please anyone can help me incorrecting the above UDF.
Thanks
Srinivas
You have not mentioned what error, but i think the error ur getting is because of the single quotes on 'DEV'- i tried a simple udf in my XI system and it worked.
String sysName = (String) System.getProperty("SAPSYSTEMNAME");
if ("XID".equals(sysName))
{
return "XIDCLNT100";
}
else
return sysName;
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks for all your answers
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
If the UDF is not working, then you may try the following:
1. Instead of if ( 'DEV' .equals(sysName) ), use if (sysnam.equals("DEV") ) and same for "QA"
2. Try String sysName = java.lang.System.getProperty("SAPSYSTEMNAME")
Regards,
Prateek
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
hi.
Can you specify more clear your question...about the code... DEV and QA are variables?...
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
85 | |
10 | |
10 | |
10 | |
7 | |
6 | |
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.