Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Executing OS-Command

Private_Member_19084
Active Contributor
0 Likes
1,261

Hi experts,

I would like to execute the following OS statement, for moving files.

"mv /dir/file /dir/archive/file"

The command runs perfect via telnet on the server.

But when I execute the same via SM69 or program code "call system id command..." I always get the following error message:

"Can't exec external program (No sucha file or directory). External program terminated with exit code 1"

Our OS is HP-UX.

Any ideas, how I can execute the statement on the server via sap?

thx in advance

1 ACCEPTED SOLUTION
Read only

former_member226519
Active Contributor
7 REPLIES 7
Read only

former_member226519
Active Contributor
Read only

0 Likes
1,082

Hello Volker,

thank you for your fast answer.

However I've solved the problem on my own.

My mistake was, that I've entered (for testing via SM69) the whole statement into "Operating system command".

So I entered: "mv <old path> <new path>".

But in this field you only have to enter the command, thus "mv".

And the <old path> and <new path> you have to enter into the field "Parameters for os".

BTW: instead of LS -L you have to use LL

Kind regards

Read only

0 Likes
1,082

BTW: instead of LS -L you have to use LL

Not necessarily.

What you have found out about command and parameter does apply here as well.

Read only

0 Likes
1,082

I am an idiot, thank you very much for correcting my crazy statement.

Read only

0 Likes
1,082

No need for a self-reproach.

We all here were beginners some time ago.

Read only

0 Likes
1,082

Now I've to solve another problem.

I would like to execute the command with quotes ("), to secure correctness by files with spaces.

so the command should be:

mv "/dir/file" "/dir/archive/file"

In telnet it runs perfect, but when I execute it in SM69, I always get the message:

No such file or directory.

So I think, SAP can't handle the quotes.

Any ideas, how I can realize this statement?

thx again

Read only

0 Likes
1,082

I've now opened an own thread for the last question (as this has nothing to do with the first question):