on 02-28-2011 9:54 AM
Hi
Is there any java code to read the server name? i need the server name in my mapping. by server name i want to know if its triggered from dev, qual or prod. by knowing this based on the server i have to insert a condition accordingly. Or can it be wriiten using a UDF?
Thanks
SG
Thanks Sarvesh and Ciochinah!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You can try it with below udf code
//Create UDF without any input parameters.
String SystemID = null;
SystemID = System.getProperty("SAPSYSTEMNAME");
return SystemID;
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 do it with an UDF, make sure to treat all your decentral adapter engines::
public String runtime_environment(Container container) throws StreamTransformationException{
// Get SAP system name
String sapSystemName = (String) System.getProperty("SAPSYSTEMNAME");
// Production:
if ("PRP".equals(sapSystemName) ) return "P";
if ("PR1".equals(sapSystemName) ) return "P";
if ("PR2".equals(sapSystemName) ) return "P";
// Quality
if ("QAQ".equals(sapSystemName) ) return "Q";
if ("QA1".equals(sapSystemName) ) return "Q";
// Development
if ("DEV".equals(sapSystemName) ) return "D";
// Prototype (indicated as developent)
if ("SND".equals(sapSystemName) ) return "D";
if ("SN1".equals(sapSystemName) ) return "D";
// Runtime environment type unkown -> raise exception
throw new StreamTransformationException("Unknown runtime environment type for system " + sapSystemName);
}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
87 | |
23 | |
11 | |
9 | |
8 | |
5 | |
5 | |
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.