Skip to Content

Python Script invoking through SAP PI.

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

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

4 Answers

  • Best Answer
    May 29, 2017 at 01:34 PM

    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

    Add comment
    10|10000 characters needed 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

  • Apr 19, 2017 at 08:48 PM

    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

    Add comment
    10|10000 characters needed 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.

  • May 08, 2017 at 09:00 AM

    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

    Add comment
    10|10000 characters needed characters exceeded

  • May 29, 2017 at 12:33 PM

    Hi Experts,

    Any suggestions or comments? Please help.

    Thanks,

    Nidhi Srivastava

    Add comment
    10|10000 characters needed characters exceeded