cancel
Showing results for 
Search instead for 
Did you mean: 

UDF Help needed

Former Member
0 Kudos


Hi

A file-to-file scenario where I've appended timestamp at the end of the filename. The task is now to append .dat at the end of timestamp.

If the file is Example

Then the target file should be as

"Exampleyyyymmddhhmmss.dat"

How can I accomplish this?

Please help.

Thanks in advance

Accepted Solutions (0)

Answers (3)

Answers (3)

sateesh437
Participant
0 Kudos

DynamicConfiguration conf = (DynamicConfiguration) container.getTransformationParameters().get(StreamTransformationConstants.DYNAMIC_CONFIGURATION);

       // Call the FileName parameter of Receiver File Adapter

DynamicConfigurationKey key = DynamicConfigurationKey.create("http://sap.com/xi/XI/System/File","FileName");

                                                                              

          String MyFileName ="Example".concat(var1).concat(".dat");

          // Set the FileName dynamically to Receiver File adapter

                 if(conf != null)

                 conf.put(key, MyFileName);

                 return MyFileName;

Former Member
0 Kudos

Hi,

You use ASMA+ Dynamic Configuration. You may set the file name as required.

http://wiki.scn.sap.com/wiki/display/XI/Dynamic+file+name+and+directory+in+Receiver+File+Adapter+-+s...

Thanks,

Sudhansu

0 Kudos

Hi Abinaya,

you do not need an UDF for this purpose.

Simply use "Example.dat" as filename pattern in the receiver communication channel and select the option "Add Time Stamp To File Name" as File Construction Mode.

The timestamp is always inserted before the last full stop in the pattern.

Best Regards,

lars