on 07-01-2011 10:25 AM
HI Experts,
This is regarding the Command line feature available in FTP channels.
Scenario : File to File
1. Is it possible to create a copy of the output file onto another directory in the target FTP server using this feature? Or is this not possible as the SAP note 841704 mentions "for the File Adapter transport protocol "FTP", the operating system command is NOT executed on the FTP server, but on the server hosting the Adapter Engine." If i want a copy onto another directory in the remote server, what are the steps to be followed?
( have gone through Michals blog /people/michal.krawczyk2/blog/2007/02/08/xipi-command-line-sample-functions but was not able to try it as i dont have permisstion to tcode SXDA_TOOLS - i believe the batch file should be uploaded to al11 using this - correct me if i am wrong here!)
2. Can we give command directly onto the command line text box (without mentioning batch file path) ? I tried using the Transport protocol as NFS and routed the file to a local directory /usr/sap/tmp with the command line having a simple command as mv %f filechange.txt. This is shown as executed successfully in CC monitoring but result is not seen.
Would like to know the possibilities of this feature- thanks in advance!
Thanks for all the answers..problem is solved while using NFS. Will post another thread if facing problems with remote execution of script.
Diya
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks for the clue regarding the prefix. The channel is not showing any error now. It shows that the command is executed succesfully but i cannot see the result of the execution.
Channel status:
2011-07-25 12:15:10 Success Write to file "/usr/sap/tmp/Output.txt" as text (character encoding ISO8859-1) size 124 bytes
2011-07-25 12:15:10 Success Execute OS command "sh /usr/sap/tmp/testftp.sh /usr/sap/tmp/Output.txt"
2011-07-25 12:15:16 Success File processing complete
2011-07-25 12:15:16 Success MP: Leaving module processor
2011-07-25 12:15:16 Success The message was successfully delivered to the application using connection File_http://sap.com/xi/XI/System.
2011-07-25 12:15:16 Success The message status set to DLVD.
The output file is created in /usr/sap/tmp. But the sh file contains a command : cp %1 /usr/sap/tmp/new.txt. This file is not created however. Any ideas?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Diya,
also in text box use uppercase F like: %F
Please use $1 instead of %1
cp $1 /usr/sap/tmp/newfile.txt
cp file1 file2 copy file1 to a file called file2
cp file1 /tmp copy file1 to the /tmp directory
cp file1 ~smith copy file1 to the home directory of "smith"
cp * /tmp copy everything in the directory to the /tmp directory
refer this
http://help.sap.com/saphelp_nw04/helpdata/en/e3/94007075cae04f930cc4c034e411e1/content.htm
When the operating system command is called, the file name currently being processed can be specified with the following placeholders:
u25CF %f (file name)
u25CF %F(absolute file name including path)
Hi SDNers,
I was able to execute command line functions by directly giving it in the text box (with transport protocol as NFS). However, the same is not working when i am trying through a batch file. Below is what i did.
1. Uploaded batch file "testftp.bat" to /usr/sap/tmp folder in XI.
2. Gave this path in command line as /usr/sap/tmp/testftp.bat %f
3. testftp.bat contains only one line - rm %1.
rm %F when directly given in the command line text box functioned succesfully. I tried giving the path in various ways but dint work. Please can anyone guide as to how to give the path / if something is wrong in the batch file?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You can create script and specify it as os command in the channel for your need. Have you seen this [link|http://wiki.sdn.sap.com/wiki/display/XI/SAPXIFileAdapterOSCommandLine+Feature]?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Diya,
In case of nfs you can directly write the command in the text box.
But in case of FTP you need to create one Batch(.bat file incase windows) or shell script file (Linux) .
From PI comm channel you can run this file in FTP server.
Refer this document for FTP commanmd.
http://www.way2sap.com/sap-article/SAP-XI-File-Adapter-OS-Command-Line-Feature-805/
Edited by: Debashish on Jul 1, 2011 11:49 AM
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
89 | |
10 | |
10 | |
10 | |
7 | |
6 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.