cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

SAP CPI - EXECUTE OS COMMAND

Former Member
0 Likes
1,683

Hi to all,

I have a big requirement that is really tricky...
Is it possible to execute a bash script in CPI? For example this kind of solution is allow on PI on premise with Adapter File, with Run Command Operating system.

Anteprima di image.png

But in CPI with the adapter File (SFTP Adapter) there isn't this feature.
Is it possible to achieve this in anyway?
My first idea is build a flow in this way:
Scheduler ---> Groovy Script ( Inside the groovy script i can read the file from File Server(test.sh) and Execute Bash) ---- > end is it possible in this way? If is possible to achieve in this way, which is the snippet code to execute command from groovy?

Please, let me know for suggests.
Thanks

Accepted Solutions (0)

Answers (1)

Answers (1)

Sriprasadsbhat
Active Contributor
0 Likes

Hello Claudio,

This feature is not supported in SAP CPI.

Could you please explain what you are trying to do with OS command.

Regards,

Sriprasad Shivaram Bhat

Former Member
0 Likes

Hi Sriprasad,

my requirement is to call an sh/bash script, that ca do many things, i don't know properly (depend from the requirement), but for example some customers use tools such as control-M or IBM Direct Connect to schedule job, file transfer using remote script for example to extract the zip file or compress or something else, with CPI we can schedule job, read and transfer file, but i am looking for call also os command.
My idea as i said is:

Use Scheduler(So it's same behaviour Job Scheduler that can offer for example Control-M or other ) ---> Groovy Script ( Inside the groovy script, I know that there is a groovy script that allow to open connection to file server and read file, my interest is open the connection to file server and execute os command, i read that there are some groovy libraries like ssh, but i don't know if it works and how is the execute command in groovy ---- > end

Thanks in advance,

Regards,
Claudio Palladino