cancel
Showing results for 
Search instead for 
Did you mean: 

Problem in DynamicConfiguration UDF

former_member537867
Active Contributor
0 Kudos

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.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi,

Can you please explain how are you trying to create 3 target files..

Regards,

Nithiyanandam

former_member537867
Active Contributor
0 Kudos

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.

former_member181985
Active Contributor
0 Kudos

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

Answers (2)

Answers (2)

Former Member
0 Kudos

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

former_member537867
Active Contributor
0 Kudos

Hi All,

Thankz for ur replys.Any more suggestions plz...

@Swetha: I already mapped with same logic but its not generating multiple files.Only with one field name one target file is getting created.

Regards,

Vinod.

former_member181985
Active Contributor
0 Kudos

The concept works as follows:

Mapping PIPELINE step ( FileName Set using UDF Dynamic Configuration) --> Call Adapter PIPELINE step ( Receiver File Adapter will use the this FileName for file generation).

So using this concept you cannt get more than one file.

Thanks,

- Gujjeti.

Former Member
0 Kudos

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