cancel
Showing results for 
Search instead for 
Did you mean: 

Renaming of file : Mail to file sceanrio

former_member190358
Participant
0 Kudos

Hello everyone,

BW would be sending the attachment of MAIL in .XLS format. i need to remane this file at runtime and post it in FTP server.

So, i am planning to write a unix script and deploy it in FTP server.

Can anyone tell me if there is any other easier option other than this.

Regards,

Ravi

Accepted Solutions (1)

Accepted Solutions (1)

former_member216353
Participant
0 Kudos

Hello Ravi,

Use Dyanic Configuration to rename your file. With this you can create a file name of your choice and write it to the FTP server.

regards,

Younus

Answers (3)

Answers (3)

Former Member
0 Kudos

Can anyone tell me if there is any other easier option other than this.

Dynamic Configuration is the simple way for changing name :

step1:

you have to write one udf for dynamic conf in msg mapping leval

udf:

String DynamicConfig(String a, Container container) throws StreamTransformationException{

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

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

conf.put(key,a);

return "";

step2:ID

in receiver file comm.cahn, enable ASMA properties .

enable check box -> file name and use asma

former_member190358
Participant
0 Kudos

Thanks everyone for giving your inputs.

My requirement is that customer will be sending 23 reports with different names and i have to give them naming convention based on the name of the attachment.

So, now can i modify the UDF to accommodate this requirement, if ia musing Dynamic configuration.

Regards,

Ravi

Shabarish_Nair
Active Contributor
0 Kudos

Unix scripts should be your last option.

I recommend using dynamic configuration and ASMA to modify the file name.

Former Member
0 Kudos

Dear Ravi

Are you placing the file directly to the FTP server (it is a bypass scenario)?

If that is the case then OS command is the best option.

Alternatively you can try writing an adapter module in the receiver file adapter just to rename the file (never tried though)

If mapping is involved then you can always use dynamic configuration to rename the file and have to enable ASMA in the adapter.

Sourabh

former_member190358
Participant
0 Kudos

Hello Sourabh,

The mapping is not involved here... Only the file is getting picked up from the mail server and needs to drop it directly in FTP server with the new name.

Can i still use Dynamic configuration and some other option is recommended here.

Regards,

Ravi

Former Member
0 Kudos

might be that is possiable with standard " Beans" / "Variable Substitution" with out mapping .

please refer step 2/3 in below link:

http://wiki.sdn.sap.com/wiki/display/XI/CombiningthreedifferentaspectsofPIinoneshot