cancel
Showing results for 
Search instead for 
Did you mean: 

Dynamic file Name generation

Former Member
0 Kudos

Hi Experts,

i have the requirement

I need to extract some records from Database (Scenario is Database to file) and we need to put it into file.

then i need to change the file name based on certain conditions and send it to relevent file server which are globally located across the world.

My Doubts are :-

1- After extracting the records from Database From where i can get file name?? Can i get the file name from SXMB_MONI. If yes then How??

2- Now I got the file name then i need to change this file name into different file names (Dynamically) based on some conditions to send it to different file servers. Can i do it in my mapping Or i need to write a module for it.??

Thanks in Advance

Regards Prajwal

Accepted Solutions (0)

Answers (3)

Answers (3)

Former Member
0 Kudos

Hi,

/people/jayakrishnan.nair/blog/2005/06/20/dynamic-file-name-using-xi-30-sp12-part--i

Give the File name at Runtime.

/people/michal.krawczyk2/blog/2005/11/10/xi-the-same-filename-from-a-sender-to-a-receiver-file-adapter--sp14

What ever the file name given in the sender you will get that name in the target side.

former_member194786
Active Contributor
0 Kudos

Hi Naluvala,

Based upon your condition you can directly set the file name using this UDF:

DynamicConfiguration conf = (DynamicConfiguration) container

.getTransformationParameters()

.get(StreamTransformationConstants.DYNAMIC_CONFIGURATION);

DynamicConfigurationKey key = DynamicConfigurationKey.create(

u201Chttp://sap.com/xi/XI/System/Fileu201D,

u201CFileNameu201D);

String valueOld = conf.get(key);

if (valueOld != null) {

String valueNew = valueOld.replaceAll(u201Cinputu201D,u201Doutputu201D);

conf.put(key, valueNew);

Instead of using get function to populate the valueOld, you can use your own logic.

Regards,

Sanjeev.

Former Member
0 Kudos

You can write file it in mapping

Refer

/people/michal.krawczyk2/blog/2005/11/10/xi-the-same-filename-from-a-sender-to-a-receiver-file-adapter--sp14

modify UDF as per your requirement