Application Development 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: 

External command not working.

Former Member
0 Kudos

Hi,

I have written a batch program which copies files from SAP Application Server(4.6B) to external machine in LAN. This machine is mapped on SAP App Server. The contents of this file are:-

@ECHO OFF

FOR /f "delims=" %%a in ('date /t') do set DATE=%%a

SET CUR-DATE=%DATE:~4,10%

XCOPY H:\source
ust-ght3dxp0097\fullc /D:%CUR-DATE%

XCOPY H:\source Z:\ /D:%CUR-DATE%

where ust-ght3dxp0097 is the external machine and Z is the mapped drive on SAP App server.

Now this batch file works fine when executed from commandline. I want to execute this from my ABAP program.

Hence I created an external command from SM69 as follows:

Operating system command

C:\CopyFilesCreatedToday.bat

This batch file is place in C drive of SAP Application Server.

When I try to execute this external command from SM49 it gives the following error.

Invalid Drive Specification

0 files copied

Invalid Drive Specification

0 files copied

Can somebody help me with this error.

9 REPLIES 9

Former Member
0 Kudos

Hi,

are you sure that you are on the correct application server? If you have more than one app-server running, this might be the error.

regards

Siggi

FredericGirod
Active Contributor
0 Kudos

Hi Stephen,

It's little hard to read your code, but I see a lot of time the same error in shell script : do you check there is no space in your file / directory name ?

Frédéric

0 Kudos

Hi Frederic/Siggi,

There is no space in between file / directory name.

And also there is only one Applicaion server running.

Stephen

0 Kudos

Do you try to do an echo ?

Don't know Microsoft Shell, but in Unix shell that display the content of a data.

Frédéric

0 Kudos

Hi,

if echo is not possible, you can try to output variables from your batch file to some output/file in order to check if they kept the values you expect, or even more, to check the existence of the files in your directories - calling dir <myDirectoryVariavle> or similar depending on your os. I've similar problems in the past - not with SAP appl. server, but with MS SQL server and execution of the batch-files via stored procedures - in some Windows (w2k, xp, 2003).

HTH

Ivaylo

Former Member
0 Kudos

Are you sure your 'H' and 'D' drives are also accessable from SAP server?

Srinivas

0 Kudos

Hi Srivivas,

"H:\Source" is on SAP server from where it is copied to

"
ust-ght3dxp0097\fullc".

The Drive "Z" is the mapped drive on SAP server of "
ust-ght3dxp0097\fullc".

Former Member
0 Kudos

Hi Peter,

The critical point maybe is this:

"Operating system command

C:\CopyFilesCreatedToday.bat"

Dont't use the local drive C:! Use a network-drive instead.

BR

Michael

0 Kudos

> Hi Peter,

>

> The critical point maybe is this:

>

> "Operating system command

> C:\CopyFilesCreatedToday.bat"

>

> Dont't use the local drive C:! Use a network-drive

> instead.

>

> BR

> Michael

Hi Michael,

Are you family of Jack Bauer? Just kidding sorry for the inconvenience

Stephan