cancel
Showing results for 
Search instead for 
Did you mean: 

Checking filename even before it comes to a FTP/SFTP location

Former Member
0 Kudos

Is there any way we can Identify/detect the name of file before it reaches to certain FTP/SFTP location ?

If yes then, Are there any options/actions which can be imposed on the file/filename before it reaches certain location ? e.g. Rejecting the file, Changing/modifying its name or even clearing the data inside the file, All before it comes to certain location.

Accepted Solutions (0)

Answers (4)

Answers (4)

anupam_ghosh2
Active Contributor
0 Kudos

Hi Saurabh,

                   In PI its not possible to alter file name or content before it reaches a specific location.

How ever you can write shell scripts (UNIX\Linux OS) or batch file (windows OS) in PI server which will read those files into PI server from  FTP/SFTP location. Once the file is read the same script can alter the file content and again put it back in other FTP / SFTP location. Here are the commands you can check http://www.cs.colostate.edu/helpdocs/ftp.html .  You have to schedule batch jobs in PI server to execute the scriots at regular intervals of time. You can create log files to within the script to check if the script has run properly or not.

Regards

Anupam  

ambrish_mishra
Active Contributor
0 Kudos

Hi Saurabh,

What you are saying is not possible in PI. I have replied to another thread where you have touched upon the issue you are facing.

Like in PI, the receiver file adapter has an option now to allow file overwrite...similarly, check with the third party if they can enforce such an option or check with the basis team if they can help enforce such a rule at the directory level (OS).

This will ensure either an error while writing the file with same name or a situation where file name is appended with a Copy or counter which you have ways to avoid.

Hope it helps!

Ambrish

Muniyappan
Active Contributor
0 Kudos

Hi Saurab,

you can write an udf and check the file name if it is correct you can pass it is.

if not you can modify as per your requirement.

you can also reject the file using routing.

Check this links if it helps you..

writing udf.

http://wiki.sdn.sap.com/wiki/display/XI/Sample+Code+-+Dynamic+Configuration+in+Java+and+ABAP+Mapping

http://scn.sap.com/community/pi-and-soa-middleware/blog/2009/03/26/dynamic-configuration-vs-variable...

routing the file

http://scn.sap.com/community/pi-and-soa-middleware/blog/2013/03/28/step-by-step-use-of-fccrd-based-o...

Regards,

Muniyappan.

zameerf
Contributor
0 Kudos

Hi Saurabh,

In Receiver Determination step, check for conditions to find the Receiver system.

In condition editor, under expression editor, select 'Context Object' and choose FileName and use the required operator to check the file name of the incoming file

and if its not the relevant file, just choose one of the option under 'If No Receiver Is Found, proceed as follows'.

If the file name is relevant, you can then dynamically modify file name in the mapping step before writing the file in the receiver location.

Hope this helps.

Regards,

Zameer