cancel
Showing results for 
Search instead for 
Did you mean: 

SFTP Sender : send file name to message mapping

Former Member

Experts

I have a sender sftp channel with Messagetransformbean to read a flat file and convert it into xml format.

I have ticked the Set Adapter specific message attributes checkbox and the File Name parameter.

I have also defined the below udf to read the filename from the namespace and send it to RFC function module to inform user via email that the file has been processed

String filename    = "";

try {

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

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

filename = conf1.get(key1);

conf1.put(key1,filename);

} catch(Exception ex){}

return filename;

My development system comm channel is FTP with content coversion. The above solution works correctly and the filename gets read and passed on to the email.

My test PI system comm channel is SFTP with messageTransformBean. In this case the dynamicConfiguration in SXMB_MONI message log shows the file name under the namespace http://sap.com/xi/XI/System/File. However the filename is not being read and sent to the function module due to which it also does not appear in the email.

Please could anybody suggest whether the channel being of type sftp is causing this issue and whether there is a solution to this.

Accepted Solutions (0)

Answers (3)

Answers (3)

Former Member
0 Kudos

Have you maintained all the mandatory key parameter values to the SFTP sender channel within the messageTransformationBean. Could you pls cross verify them.

Are you receiving any error messages in your communication channel logs?

former_member184789
Active Contributor
0 Kudos

Hi,

In the code, could you try changing the namespace to http://sap.com/xi/XI/System/File 

instead of

http:/"+"/sap.com/xi/XI/System/File

Also please go through:

http://scn.sap.com/thread/3178909

http://scn.sap.com/community/pi-and-soa-middleware/blog/2012/04/11/sap-sftp-sender-adapter-a-quick-w...

anupam_ghosh2
Active Contributor
0 Kudos

Hi Girish,

              Code seems to be ok for SFTP adapter. In test system there might be exceptions being thrown. Please add trace statement within the catch block  to find the reason of exception as shown in this thread http://scn.sap.com/thread/2116038

Regards

Anupam