on 02-12-2009 9:57 AM
Hi Frnds,
I'm using following code to dynamically generate a file name from Source field. For instance source field name is FLD1, but for single occurence of this source field
UDF is working fine. But when this FLD1 is repeated 3 times for example then i want 3 target files with this FLD1 field values. I customised to some extent but it is not working for me.
UDF Code:
a = "raw_text_" + a + ".txt";
DynamicConfiguration conf = (DynamicConfiguration) container
.getTransformationParameters()
.get(StreamTransformationConstants.DYNAMIC_CONFIGURATION);
DynamicConfigurationKey key = DynamicConfigurationKey.create(
"http://sap.com/xi/XI/System/File", "FileName");
for(int i =0;i<a.length();i++)
{
conf.put(key, a);
}
return a;
Any sugestions plz ????
Regards,
Vinod.
Hi,
Can you please explain how are you trying to create 3 target files..
Regards,
Nithiyanandam
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Nityanand,
Actually if Src field(for eg: FLD1) if this FLD1 occurs 3 times then i need 3 target files with names as
FLD1.txt,FLD2.txt,FLD3.txt...etc. So how to customise UDF to acheive target files as mentioned ???
@Sarvesh: Yes it is 0..1 as per ur advice i will change it to unbounded but wat should be the logic
written in UDF ...
Regards,
Vinod.
As far as I know that is not possible, since your triggering on source(sender) side is only once(even though the payload contains repeated values for particular Field).
The UDF only does changes to FileName as per the repetition and the last value will be used for target file name.
Note:Once the Mapping PIPELINE step is completed then only the FileName (Set from UDF Dynamic Configuration) will be used at Call Adapter PIPELINE step which will be used by Receiver File Adapter.
Thanks,
- Gujjeti.
Edited by: Praveen Gujjeti on Feb 12, 2009 4:24 PM
Edited by: Praveen Gujjeti on Feb 12, 2009 4:29 PM
Hi Vinod,
I am not sure, jus try this one in your mapping taking length of the queue as teh input to UDF...
sourcefield->remove contexts->UDF->Target field
Edited by: Swetha Reddy on Feb 12, 2009 11:54 AM
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Not sure but you can try by changing the occurrence of FLD1 as 0..unbounded. I guess presently it will be 0..1 or 1..1
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 | |
10 | |
10 | |
10 | |
7 | |
6 | |
6 | |
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.