cancel
Showing results for 
Search instead for 
Did you mean: 

OS command not executing vai file adapter - URGENT!

Former Member
0 Kudos

Hello Experts,

I have IDOC to File scenario where I create a file on my XI IBM AIX server (same as unix) via FTP. The I need to run a shell script on this created file and modify it. I have done all the configurations correctly and no error is shown anywhere but the shell script doesnt seems to execute. When I run the same schipt on the AIX server it works perfectly fine.

The scenario is I create a file ABC.asc at location /SAP/output on my XI server say 10.0.0.11 via FTP. My shell script file_modify.sh is stored at location /SAP. On the "Run Operating System Command After Message Processing", i write the following command:

sh /SAP/file_modify.sh %F

In communication channel monitoring it shows

"Execute OS command sh /SAP/file_modify.sh /SAP/output/ABC.asc" "File Processing complete".

But nothing seems to be happening. XI is creating the file ABC.asc but the shell script is not executing. I am working on PI 7.0 SP9.

What can be the error? Please help. My XI server is teh same server where I am FTPing the file i.e. 10.0.0.11.

Thanks,

Yash

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi,

You are not having the proper execute rights to execute the script from the XI system. The user which u r using shud have proper execute rights to execute.

Request ur system admin to provide the proper execute rights for the user which ur using.

Thanks,

Ramesh

former_member211899
Participant
0 Kudos

Hi Ramesh,

I am facing a similar error.

Can you kindly elaborate on the rights / roles to be provided.

I believe that we have to grant this permission to the user id <SID>adm. Am i right ?

Regards,

Krishna

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi Yash,

My XI server is teh same server where I am FTPing the file - Then why are you FTPing the file, instead use File System as message protocol and then see whether your OS command is getting executed or not........i think using File System should solve your query.

Regards,

Rajeev Gupta

GabrielSagaya
Active Contributor
0 Kudos

Target Directory=/SAP/output/

FileName Scheme=ABC.asc

File type=Binary

OS command=/SAP/file_modify.sh %F

Since your SP=9 it should work.

if not working chek your file_modify.sh

/people/sameer.shadab/blog/2005/09/21/executing-unix-shell-script-using-operating-system-command-in-xi

Former Member
0 Kudos

Hi Gabriel,

I have tried exactly the same as you ahve mentioned and even the shell script is correct as it works when I run it independently directly on the server. but its not working via XI. Is it that I am creating the file via FTP but running the OS command directly? But then I am creating on the XI server itself via FTP.

Please suggest something.

@Ramesh:

I am creating the file on the server via FTP using the root username which normally has all the rights. Can this be a proble or should I use my XI admin user?

Thanks,

Yash

GabrielSagaya
Active Contributor
0 Kudos

I think the problem is in your FTP server Config..

then

check your FTP port, rights...

check msg payload too

Former Member
0 Kudos

Hi Agarwal,

Its not the XI admin user or the user ur using.

Check the script file properties, it will have something like this rwx rwx rwx.........it shud have executable rights.

Then after that you can check with root user/any other user who has executable rights.

Thanks

Ramesh

Former Member
0 Kudos

Hi Ramesh,

Intially I was trying to login to the FTP server (same as XI server) via ROOt login and run the script from that login itself but it was not working. Then I changed the login from root to XI admin user and the script started running properly. I have also give executable rights to the script.

Thanks for the help.

Regards,

Yash