cancel
Showing results for 
Search instead for 
Did you mean: 

How to identify environment dev,qa,prd in java udf used in message mapping

Former Member
0 Kudos

Dear Friends,

I want to identify the environment ( DEV, QA, PROD) the map being executed at run time to dynamically return url from java user defined function to be used in message mapping.

If you could help with some thoughts , it would be great help and appreciate it.

Thanks.

Suraj.

Accepted Solutions (0)

Answers (5)

Answers (5)

Former Member
0 Kudos

Hi

You can try this.



java.util.Map map = container.getTransformationParameters();
String machineName = "";
AbstractTrace trace	= container.getTrace();

try{
	machineName = java.net.InetAddress.getLocalHost().getHostName();
}catch (java.net.UnknownHostException e){
	trace.addWarning("Can't get hostName");
}

........


Regards

Luis.

Former Member
0 Kudos

Guide to use Mapping runtime constants -http://help.sap.com/saphelp_nw04/helpdata/en/43/09b16006526e72e10000000a422035/frameset.htm

Former Member
0 Kudos

Hi,

another to possibility to avoid to do such a test and to hardcod URL (or another dynamic info) in your message mapping, it's to use:

- a value mapping: defined in Integration directory, and used in MM.

- or why not an Operation Mapping's parameter: defined in the Receiver Interface, and used in MM. See: the Parameterized mapping:

[|https://www.sdn.sap.com/irj/scn/weblogs?blog=/pub/wlg/8654] [original link is broken] [original link is broken];.

[|http://help.sap.com/saphelp_nwpi71/helpdata/en/43/bbb7fd90f5332ee10000000a11466f/frameset.htm]

[|https://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/909e33f0-738c-2a10-4f87-ce73398bcf08]

regards.

mickael

Former Member
0 Kudos

Hi Suraj,

You can use Fixvalues mapping. Based on the sender function mentioned by Martin, you can further get the URL based on the Fixed Value mapping.

Regards

Krish

Former Member
0 Kudos

Hi,

in message mapping there is a function under Constants called sender or receiver which return the sender or receiver business system.

Otherwise, in a UDF you can use the Java system property SAPSYSTEMNAME which returns the SID of the SAP instance:

java.lang.System.getProperty("SAPSYSTEMNAME");

Regards, Martin