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

OS Command net use, SM69 - write to networkdrive

matthias_kasig2
Participant
0 Likes
955

Hi,

we are on a 4 .7 system.

we need to write from ABAP to a networkdrive by first initializing the connection to it, as it is not permanently mapped to the sap application server. There is a dos os-command

"net use <drive>:
remoteserver\share password /user:domainname\username" which works fine fom dos prompt.

i put it in a sm69 command.

testing in sm49 shows:

if the drive letter already exists on the sending server, I get an error message, that tells exactly the driveletter is occupied.

otherwise I get:

 System error 67 has occurred.                 
                                               
 The network name cannot be found.             
                                               
 External program terminated with exit code 2 

In my case I noticed, that I can miss out the password/user part and the sm49 test seems to work, if the driveletter is free - I don't get any other messages, neither success or failure

now I put the command (without password/user) in FM SXPG_CALL_SYSTEM, which only expects the commandname and one optional parameter, but I get an exception:

X_ERROR

if I use the FM with the longer version including password/user I get the same error as above:

 System error 67 has occurred.                 
                                               
 The network name cannot be found.             
                                               
 External program terminated with exit code 2 

some ideas about this?

regards, matthias

ps: I can't reply before Monday as I am out of office, but will surely return on Monday

Message was edited by:

Matthias Kasig

1 ACCEPTED SOLUTION
Read only

Clemenss
Active Contributor
0 Likes
543

Hi Mathias,

sorry I don't remember the details: I think you have to or have <b>not</b> to enclose the parameter values in quotes. Try both.

Then it may be important if you specified the command in upper/lower case letters - try both.

I think the command entry should be just 'net', the rest to be passed as PARAMETERS.

It may help to issue the net comand first with parameter 'use /delete' to free the drive letter if it is already occupied,

Regards,

Clemens

Hi,

we are on a 4 .7 system.

we need to write from ABAP to a networkdrive by first initializing the connection to it, as it is not permanently mapped to the sap application server. There is a dos os-command

"net use <drive>:
remoteserver\share password /user:domainname\username" which works fine fom dos prompt.

i put it in a sm69 command.

testing in sm49 shows:

if the drive letter already exists on the sending server, I get an error message, that tells exactly the driveletter is occupied.

otherwise I get:

 System error 67 has occurred.                 
                                               
 The network name cannot be found.             
                                               
 External program terminated with exit code 2 

In my case I noticed, that I can miss out the password/user part and the sm49 test seems to work, if the driveletter is free - I don't get any other messages, neither success or failure

now I put the command (without password/user) in FM SXPG_CALL_SYSTEM, which only expects the commandname and one optional parameter, but I get an exception:

X_ERROR

if I use the FM with the longer version including password/user I get the same error as above:

 System error 67 has occurred.                 
                                               
 The network name cannot be found.             
                                               
 External program terminated with exit code 2 

some ideas about this?

regards, matthias

ps: I can't reply before Monday as I am out of office, but will surely return on Monday

Message was edited by:

Matthias Kasig

1 REPLY 1
Read only

Clemenss
Active Contributor
0 Likes
544

Hi Mathias,

sorry I don't remember the details: I think you have to or have <b>not</b> to enclose the parameter values in quotes. Try both.

Then it may be important if you specified the command in upper/lower case letters - try both.

I think the command entry should be just 'net', the rest to be passed as PARAMETERS.

It may help to issue the net comand first with parameter 'use /delete' to free the drive letter if it is already occupied,

Regards,

Clemens