cancel
Showing results for 
Search instead for 
Did you mean: 

UDF to get the systemdetails in message mapping

Former Member
0 Kudos

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

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

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;

Answers (3)

Answers (3)

Former Member
0 Kudos

Thanks for all your answers

prateek
Active Contributor
0 Kudos

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

Former Member
0 Kudos

hi.

Can you specify more clear your question...about the code... DEV and QA are variables?...