Skip to Content
0

Python Script invoking through SAP PI.

Apr 17, 2017 at 03:25 PM

152

avatar image

Hi Experts,

In SAP PI can we use file adapter command line argument to invoke python scripts? I used unix script but I am not sure about python script.

If someone used the python script invoking through PI, please guide over this.

Thanks,

Nidhi Srivastava

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

4 Answers

Best Answer
Manoj K May 29, 2017 at 01:34 PM
0

Nidhi,

Instead of directly calling the python script from FTP adapter , have you tried to write a simple shell script which calls this python script.

And in FTP adapter you can call this shell script . Bdw what exactly this python script is doing ? why dont you write that in shell script?

Br,

Manoj

Show 1 Share
10 |10000 characters needed characters left characters exceeded

Hi Manoj,

There are many python scripts which are doing some tasks at the server level and client don't want to touch those scripts. We will try using the option of calling python script in shellscript.

Thanks.

Br,

Nidhi

0
Nidhi Srivastava Apr 19, 2017 at 08:48 PM
0

Hi Experts,

Any suggestions on the above issue?

I tried executing a simple helloworld script using python(run using cmd) and it is working fine. But, when I try using the same through command line argument I am getting error. It seems the syntax is incorrect.

From PI,

Execute access is given to the file. How it can trigger pointing to the location where python is installed?

Please suggest.

Thanks,

Nidhi Srivastava


python-run.jpg (28.0 kB)
python-run.jpg (28.0 kB)
python-pi-cmla.jpg (64.8 kB)
Show 1 Share
10 |10000 characters needed characters left characters exceeded

Hi Nidhi,

I realize this question is old and you may not be having this issue any more, but is the Python executable on the PATH of the system that you were trying to execute it on? In your screenshot you are getting python to run on the command line when in the directory where it is installed, but does that work from other directories as well (like your Desktop)? If not, then I suspect that adding Python to your path could resolve the issue.

0
Nidhi Srivastava May 08, 2017 at 09:00 AM
0

Hi Experts,

We installed python on SAP PI Server and able to run the python script from command prompt(running fine).

When we are trying to test using Command line argument(FTP adapter) it is not executing, Error in processing the argument.

Command given - python "C:/python27/nidhi.py"

Can we only run shell script using SAP PI command line argument? Python cannot be executed?

Please suggest.

Best Regards,

Nidhi Srivastava

Share
10 |10000 characters needed characters left characters exceeded
Nidhi Srivastava May 29, 2017 at 12:33 PM
0

Hi Experts,

Any suggestions or comments? Please help.

Thanks,

Nidhi Srivastava

Share
10 |10000 characters needed characters left characters exceeded