on 10-14-2013 2:10 AM
Hi,
I have a scenario wherein I have to poll and pick up files (SFTP) at certain times of the day (i.e. 12pm, 3pm, 4pm, 9pm) and I've implemented ATP to achieve this. The filename indicates the time that it needs to be processed. For instance, 'Filename_HH.xml' where HH is the processing time (i.e. Filename_12, Filename_15). So at 12pm, I only need to pick up Filename_12, then at 3pm, get Filename_15 and so on. How can I instruct the channel to do this?
Thanks!
Why not use the "Run Operating System Command Before Message Processing" to run a script that will determine what hour it is and then change the file name based on that. Then have your CC channel look for the changed name
So if it is 3:00PM (1500 hours) the script will notice it is 15, change Filename_15 to Filename_PROCESSNOW and the channel will only look for Filename_PROCESSNOW.
Hope that helps.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
No I am sorry I don't. What you can do is create a .bat file in a folder and place your scripts in that file. Then in the "Run Operating System Command Before Message Processing" field, place the path to that .bat file.
For example \\localPIMachine\FileRename.bat
Where FileRename.bat contains Windows Scripting to look for all files in a certain folder with a certain name and rename them. You will probably have to map a drive from the PI server to the FTP server so you can access the folder on the FTP server by drive letter. i.e. G:\.
Hope this helps
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Gagandeep Batra and Vedran Kubelka,
With your solution Mark would get all the files and he only could to filter in message mapping what file to take, but he would lose the rest for a next polling, may be i missunderstand you in something.
Regards,
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Mark
As vedran said you can do this with mapping with date function
plz see below:
& i use following code:
---------------------------------------------------------
DynamicConfiguration conf = (DynamicConfiguration) container.getTransformationParameters().get(StreamTransformationConstants.DYNAMIC_CONFIGURATION);
DynamicConfigurationKey key = DynamicConfigurationKey.create("http://sap.com/xi/XI/System/File","FileName");
String SourceFileName = conf.get(key)
String fname = SourceFileName + var1;
conf.put(key,fname) ;
return "" ;
------------------------------------------
and remember also to select ASMA parameter at sftp side also
Regards
gAgan
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi, in mapping you can define what is file name.
Something like this with time function
DynamicConfiguration conf = (DynamicConfiguration) container
.getTransformationParameters()
.get(StreamTransformationConstants.DYNAMIC_CONFIGURATION);
String fname = "your file name";
DynamicConfigurationKey key = DynamicConfigurationKey.create( "http://sap.com/xi/XI/System/File", "FileName");
// set up file name for receiver adapter
String SourceFileName = conf.get(key);
conf.put(key, fname);
return " ";
This function is mapped on top element. And in communication channel put "*" as File name
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Mark,
I dont know if your SFTP adapter if it is from SAP in 7.3 version or an external one. I think that you could do two scenario SFTP - FILE and FILE-XXXX. The first one you get all the files in the SFTP server and they will be downloaded in filesystem availabe via NFS by PI . In the second one scenario you could get the files by date in the name with:
1. OS system command as Dave said. Check this thread: http://scn.sap.com/thread/1725145
2. Via directoy api. I havent done this, and i dont know 100% secure that it will works. Check the remarkable William Li's document: http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/c0487ced-f537-2d10-249d-f6c7323c2...
Regards.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
94 | |
11 | |
10 | |
9 | |
9 | |
7 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.