on 04-23-2008 9:48 AM
Hi Can any one provide me UDFfor following Requirement.
My source file name is like this XXXX081090001 and i want reciver file name as XXXXMT940.
Where MT940 is constant and XXXX is first 4 digits of Source file name.
Note that First four digits of Source file name can change.
Example :- Source file name ABC081090001 -
Target should be ABCMT940
and if Source file name is XYZ091100002 -
Target should be XYZMT940.
Thanks in advance....
Hi,
try this code,
udf is context type,
single input i.e your source name
for(int i=0;i<sourceName.length;i++)
{
String store = "";
store = sourceName<i>.substring(0,4);
store = store + "MT940";
result.addValue(store);
}
Regards,
Rohit
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 one...
DynamicConfiguration conf = (DynamicConfiguration)
container.getTransformationParameters().get
(StreamTransformationConstants.DYNAMIC_CONFIGURATION);
DynamicConfigurationKey key = DynamicConfigurationKey.create
("http://sap.com/xi/XI/System/File","FileName");
String input = conf.get(key);
String s1 = input.substring(0,4);
String s2 = "MT940";
String newfile = s1.concat(s2);
conf.put(key,newfile);
return (newfile);
Consider to set "Filename" in the Adapter Specific Message Attributes in FileAdapter.
Regards,
Ralph
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Ralf,
Thanks for ur Reply
this UDF not working
Error Description
RuntimeException in Message-Mapping transformation: Exception:[java.lang.NullPointerException] in class com.sap.xi.tf._MM_eSTATEMENT_SWIFT_ method Filename$[X1010810901100001, com.sap.aii.mappingtool.tf3.rt.Context@59ca59ca]
Thanks
Edited by: Dinesh on Apr 23, 2008 4:41 PM
Edited by: Dinesh on Apr 23, 2008 5:20 PM
Hi,
In my opinion this will help you..
Part-1
/people/jayakrishnan.nair/blog/2005/06/20/dynamic-file-name-using-xi-30-sp12-part--i
Part-2
/people/jayakrishnan.nair/blog/2005/06/28/dynamic-file-namexslt-mapping-with-java-enhancement-using-xi-30-sp12-part-ii
Regards,
Sarvesh
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
you could do it with the standard functions:
substring, concat and constant
Use the substring function for taking the first 4 chars and
then concat the result with constant (MT940).
Regards
Patrick
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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.