cancel
Showing results for 
Search instead for 
Did you mean: 

Dynamic FileName based on environment

Former Member
0 Kudos

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

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

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;
}

Answers (2)

Answers (2)

Former Member
0 Kudos

Thank you all!

problem solved with environmentname, I'm also studying Value Mapping for future use!

Fabio

bhavesh_kantilal
Active Contributor
0 Kudos

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

Former Member
0 Kudos

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