on 10-20-2011 4:31 PM
Hi expert,
I have a proxy to file scenario in which I create dynamic FileName using an UDF. I'm using UDF because filename must contains date with a particular date format (yyDHHmm).
My need is to generate file name prefix based on environment, for example:
In DEV environment FileName must start with T
In QTY FileName must start with Q
In Prod FileName must start with G.
Is possible to catch the environment name in UDF (I think from DynamicConfiguration)?
Which values I have to test in the IF statement?
thanks,
Fabio
Hi Fabio,
Is possible using:
String EnvironmentName = (String) System.getProperty("SAPSYSTEMNAME");
Then, you can use the IF statement and a Concatenate statement:
String output = null;
if (EnvironmentName == 'DEV') {
output = "D" + Filename;
} else if (EnvironmentName == 'QAS') {
output = "Q" + Filename;
} else if (EnvironmentName == 'PRD') {
output = "P" + Filename;
}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thank you all!
problem solved with environmentname, I'm also studying Value Mapping for future use!
Fabio
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
My Recommendation is to use Value Mapping. You can use the Key - Value pair concept of Value Maps and configure / change the value in each environment in the Integration Directory.
Regards
Bhavesh
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Yes, I agree with Bhavesh.
Value Mapping is the Best Solution Approach :
http://www.sdn.sap.com/irj/scn/index?rid=/library/uuid/00ee347e-aabb-2a10-b298-d15a1ebf43c5
User | Count |
---|---|
85 | |
10 | |
10 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.