on 01-28-2015 6:06 AM
Hi,
Am using below code for Dynamic file name.
try{
String filename = "";
DynamicConfiguration conf1 = (DynamicConfiguration) container.getTransformationParameters().get(StreamTransformationConstants.DYNAMIC_CONFIGURATION);
DynamicConfigurationKey key1 = DynamicConfigurationKey.create( "http:/"+"/sap.com/xi/XI/System/File","FileName");
filename = BUKRS+"GSBER"+Filename+".CSV";
conf1.put(key1,filename);
return filename;
}
catch(Exception e)
{
String exception = e.toString();
return exception;
}
Here, my requirement is GSBER value will have three combinations 9999,0201,1450. SO these 4 digit value should be converted to 1 digit and need ot send to filename in place of GSBER.
So with Fix values am trying to convert it to 1 digit in the following way..
9999 = A
0201 = B
0203 = C
So can any body help me with the piece of Java code which is needed to convert this 4 digit to 1 digit.
Thanks in Advance..!
--
Regards
Raj
if(GSBER.equals("9999")) {
GSBER = "A";
} else if(GSBER.equals("0201")) {
GSBER = "B";
} else if(GSBER.equals("0203")) {
GSBER = "C";
}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Swee Yeoh,
Thanks for your reply. I have added this condition in UDF but still the file name is printing as "LBGVPFVPFPARGSBER000220150128-073954-850"
Below is the code which I am using in the UDF..
try{
String filename = "";
DynamicConfiguration conf1 = (DynamicConfiguration) container.getTransformationParameters().get(StreamTransformationConstants.DYNAMIC_CONFIGURATION);
DynamicConfigurationKey key1 = DynamicConfigurationKey.create( "http:/"+"/sap.com/xi/XI/System/File","FileName");
filename = BUKRS+"GSBER"+Filename+".CSV";
if(GSBER.equals("9999")) {
GSBER = "A";
} else if(GSBER.equals("0201")) {
GSBER = "B";
} else if(GSBER.equals("0203")) {
GSBER = "C";
}
conf1.put(key1,filename);
return filename;
}
catch(Exception e)
{
String exception = e.toString();
return exception;
}
Can you please tell me where I need to correct.?
thanks in advance.!
--
Regards
Raj
Hi Raj,
Modify your code as below :
try{
String filename = "";
DynamicConfiguration conf1 = (DynamicConfiguration) container.getTransformationParameters().get(StreamTransformationConstants.DYNAMIC_CONFIGURATION);
DynamicConfigurationKey key1 = DynamicConfigurationKey.create( "http:/"+"/sap.com/xi/XI/System/File","FileName");
if(GSBER.equals("9999")) {
GSBER = "A";
} else if(GSBER.equals("0201")) {
GSBER = "B";
} else if(GSBER.equals("0203")) {
GSBER = "C";
}
filename = BUKRS+GSBER+Filename+".csv";
conf1.put(key1,filename);
return filename;
}
catch(Exception e)
{
String exception = e.toString();
return exception;
}
User | Count |
---|---|
87 | |
10 | |
10 | |
10 | |
7 | |
6 | |
6 | |
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.