cancel
Showing results for 
Search instead for 
Did you mean: 

Pick up File from Shared Directory

itabhishek9
Participant
0 Kudos

Hi SDNites,

I have a scenario where I have to pick a file form the shared directory and read the file name which will be used as an input for RFC look up and then send the file as an attachment via email obtained from Look up.

Can you please guide me do I need to build IR componet for sender as I am not reading the file contents and how will I read the file name (I know we have to create UDF for the same) and pass it to RFC look up.

Regards,

Abhishek

Accepted Solutions (0)

Answers (3)

Answers (3)

nabendu_sen
Active Contributor
0 Kudos

Hi Abhishek,

Your scenario is going to be like below:

File (Sender Adapter without Content Conversion) -->  Message Mapping (UDF to read FileName + RFC Lookup [Request + Response]) --> Email (File as Attachment).

You can follow the below blog for File to Email Scenario (). You don't need the Module creation. Skip that part. Otherwise the blog mentioned by .

Use the UDF Code provided by .

Refer this blog for RFC Lookup:

If you want to use RFC Lookup from UDF:



Can you please guide me do I need to build IR componet for sender as I am not reading the file contents and how will I read the file name (I know we have to create UDF for the same) and pass it to RFC look up.

You are not reading the File (not using FCC) but it has to be File --> Mail Scenario.

So you need to build all the required configuration for this flow.

Regards,

Nabendu.

Former Member
0 Kudos

Dear Abhishek,

You can use the following code to get the File Name while mapping...

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

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

String MyFileName = dynamicconfiguration.get(name); //assigning the filename to local variable

return MyFileName;

Also please choose the option on Sender File Adapter CC "set Adapter-specific message attributes" and "File Name".

The output of above UDF will be input for your RFC Lookup.

Please use the following link to send the file to a mail as an attachment.

http://wiki.scn.sap.com/wiki/display/XI/Step+by+Step+Mail+To+File+Scenario

Thanks-

Ramesh.

Harish
Active Contributor
0 Kudos

Hi Abhishek,

for file to email scenario please refer the below document

http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/6d967fbc-0a01-0010-4fb4-91c6d38c5...

for RFC lookup based on file name refer the below blog

regards,

Harish