on 04-16-2014 2:20 AM
Hi
I have seen and viewed piles of discussion and blogs and SAP help about this option in the File Adapter.
Seems easy. But I cannot get it to work.
My Receiver File Adapter writes my file to a directory OK. I then run OS command (Windows Server) to unzip the file.
If I do this myself at the command line it works fine. But the same type of command in the Adapter does nothing...I can't even get the results of what it did when piping to an output file.
So I have really dumbed it down and even that does not work from the adapter.
Here is the command
cmd.exe /c "echo hello > errorlog1.txt"
The log for the File Adapter shows this
Information Write to file "D:\TESTHARNESS\TARGET\FILES_EMAILED\LAS_Data_Mar14_03.zip" as binary, size 961380 bytes
Information Execute OS command "cmd.exe /c "echo hello > errorlog1.txt""
Information File processing finished
So why for a Windows server running SAP PI7.31 does this simple command not write out the result of the echo ?
Hi Jonny,
You can write a shell scripting file to unzip the file. And placed it into some location on the SFTP server.
At Receiver adapter OS command line you just need to provide the path of the script first, name of the file to be unzipped and then the path where you want to place the file.
The OS command line should look like this:
sh -x /<Location where the script is places in server>/<FileName_to_unzip_the_file.sh> <File which is to be unzipped> /<Target location >/
Script should be like this:
******************************************************************************
_FileName=$1
_FilePath=$2
cd $_FilePath
unzip $_FileName $_FileName.zip
chmod 777 $_FileName (Use this if you dont have the proper permission)
rm $_FileName.zip (If you want to delete the zipped file use this command)
***************************************************************************************
P.S.: "<FileName_to_unzip_the_file.sh>" here .sh is the extension that is to be given to the script file which would unzip your file, as this is a shell scripting.
Hope this would help you.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Jonny,
We came across such a scenario. Which was opposite to yours.
We had to write a password protected zipped file to the target directory.
Although we were able to zipped it successfully, but couldn't able to unzipped it to check if it successfully zipped or not. As we don't have the proper permission.
That's why we used "chmod" to get access.
This might be the case with you also. Check if you have proper permission to do so.
Jonny,
Plz chk the below link
SAP XI File Adapter OS Command Line Feature:
http://wiki.scn.sap.com/wiki/display/XI/SAP+XI+File+Adapter+OS+Command+Line+Feature
..............
Mutti.
Hi Jonny,
Have you tried to create batch file and execute at receiver File communication channel in Command Line?
Regards,
Krupa
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Jonny
Just curious, if you just want to unzip the file, have you tried it using the PayloadZipBean module?
Rgds
Eng Swee
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Yes - I've followed that and tried all combinations. Even given the Guest userid the role SAP_XI_CONFIG_FILE_OS_CMD_J2EE as per 1717530.
In the File Receiver advanced mode tab I have also set oscomamnd.trace = true.
There is an error reported in the log but it seems to provide nothing useful as to the cause even down into the application logs.
I don't think you should assign this role to the user "guest" instead to the user who is defining them in Integration Directory i.e. to your user ID.
1669957 - Authorization to change OS commands in File adapter
User | Count |
---|---|
84 | |
10 | |
10 | |
10 | |
7 | |
6 | |
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.