on 12-15-2008 7:30 AM
Hello Gurus,
I have a requirement where in my input filename is : ABCD#XXX_YYYYMMDD_HHMMSS
I want my output filename as : VN01MMDDYY01
Where VN01 is the companycode which is in the Header field of my input file.
MMDDYY should be extracted from my input filename.
01 is static.
How do I alter my Dynamic Configuration to achieve this?Please guide me...
Thanks in advance..
Regards,
Swathi.Suresh
Hey Praveen..
I got the output.I was stuck up because of the substring function in my UDF.
I was passing the input parameters like this : valueOld.substring(13,2)
Where as i should have passed the parameters like this : valueOld.substring(13,15).
Realized it lately.Nyways thanx for your help:)
Regards,
Swathi.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Praveen,
The UDF that you sent is working,but it does not serve my purpose.
I am just getting the Source Filename as my Target Filename.No changes are being reflected.Neither the Compant Code nor the expected date format is found in the Target Filename.
Regards,
Swathi.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Praveen..
I tried the UDF that you sent.I am gettin this error when I try to activate.
Source code has syntax error:
: missing return statement } ^ 1 error
Whereas the code is absolutely right.What should I do?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
Try this,
String tmp = null;
try
{
DynamicConfiguration conf = (DynamicConfiguration)
container.getTransformationParameters().get(StreamTransformationConstants.DYNAMIC_CONFIGURATION);
DynamicConfigurationKey KEY_FILENAME = DynamicConfigurationKey.create("http://sap.com/xi/XI/System/File","FileName");
String fileName = conf.get(KEY_FILENAME);
tmp = a + (fileName.substring(fileName.indexOf("_")+5, fileName.indexOf("_")+7)) + (fileName.substring(fileName.indexOf("_")+7, fileName.indexOf("_")+9)) + (fileName.substring(fileName.indexOf("_")+3, fileName.indexOf("_")+5)) + "01";
conf.put(KEY_FILENAME, tmp);
}
catch (Exception e)
{
e.printStackTrace();
}
return tmp;
Edited by: Praveen Gujjeti on Dec 15, 2008 11:22 AM
Edited by: Praveen Gujjeti on Dec 15, 2008 11:33 AM (try this now)
Hi,
VN01(From Source) >UDF>output field
try
{
DynamicConfiguration conf = (DynamicConfiguration)
container.getTransformationParameters().get(StreamTransformationConstants.DYNAMIC_CONFIGURATION);
DynamicConfigurationKey KEY_FILENAME = DynamicConfigurationKey.create("http://sap.com/xi/XI/System/File","FileName");
String fileName = conf.get(KEY_FILENAME);
String tmp = a + (fileName.substring(fileName.indexOf("_")+5, fileName.indexOf("_")+7)) + (fileName.substring(fileName.indexOf("_")+7, fileName.indexOf("_")+9)) + (fileName.substring(fileName.indexOf("_")+3, fileName.indexOf("_")+5)) + "01";
return tmp;
}
catch (Exception e)
{
e.printStackTrace();
}
- Gujjeti.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
84 | |
25 | |
12 | |
9 | |
6 | |
6 | |
5 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.