REName files on server [RESOLVED]

Development (ABAP Development WorkBench, ABAP/4 programming)

Moderators: Snowy, thx4allthefish, YuriT, Gothmog

Post Reply
Ronster
Posts: 134
Joined: Thu Apr 14, 2005 3:07 am
Location: Holland

REName files on server [RESOLVED]

Post by Ronster » Wed Apr 04, 2007 10:22 am

hi all,

I've tried various solutions found on this and other sites, but I can't get the next thing to work (renaming a file on the server):

System: Operating system Windows NT

I created a command with SM69 ZREN. In the 'operating system command' I put the next line:

Code: Select all

cmd /c ren %1 %2
The checkbox for 'Additional parameters allowed' is true.

In my ABAP I call function

Code: Select all

SXPG_COMMAND_EXECUTE
with command 'ZREN'. I tried to add the two file names in the 'additional parameters' parameter, but whatever I try it doesn't work. The function keeps telling me
The syntax of the command is incorrect.

Who can help me out?
Last edited by Ronster on Wed Jun 13, 2007 7:43 am, edited 3 times in total.
Cheers!

Ron.

q4u
Posts: 444
Joined: Wed Mar 08, 2006 7:02 am

Post by q4u » Wed Apr 04, 2007 10:45 am

<deleted>
Last edited by q4u on Mon Jun 29, 2009 11:44 am, edited 1 time in total.

Ronster
Posts: 134
Joined: Thu Apr 14, 2005 3:07 am
Location: Holland

Post by Ronster » Wed Apr 04, 2007 10:55 am

I uploaded your program and started it, but it doesn't work. Getting the hourglass for minutes!
Isn't that for Unix servers? (looking at the program name) we're on Windows NT server here...

m@t
Posts: 4119
Joined: Thu Sep 04, 2003 7:37 am
Location: Switzerland

Post by m@t » Wed Apr 04, 2007 1:47 pm

Oh come on. Work out what it does, and rewrite for windoze.

5 mins.

If you want me to do it for you, tell me where to send the invoice for €100.

...hang on

Code: Select all

*     You can use or modify this report for your own work as long
*               as you don't try to sell or republish it. 
Smeg.

m@t
TULY Image The quality of answers is roughly proportional to the quality of the question.

The downside of being better than everyone else is that people tend to assume you're pretentious.

Ronster
Posts: 134
Joined: Thu Apr 14, 2005 3:07 am
Location: Holland

Post by Ronster » Thu Apr 05, 2007 2:41 am

Wow, you charge 100 for 5 minutes? No wonder you live in switserland! ;-)

MattG
Posts: 809
Joined: Wed Oct 23, 2002 2:06 pm
Location: England

Post by MattG » Thu Apr 05, 2007 3:28 am

M@t

You are not selling the program, but your time to change it.




Ronster

Do not forget to add time and legal fees for setting up the contract, and writing it.
MattG.
Image Search SAPfans

Ronster
Posts: 134
Joined: Thu Apr 14, 2005 3:07 am
Location: Holland

I can't use this solution...

Post by Ronster » Thu Apr 05, 2007 4:25 am

OSS 9391

Symptom
Keyword: Calling external programs

How should a non-ABAP/4 program be called from within an ABAP/4 environment?

..

4. CALL command (is not released and should not be used)

Additional key words

Cause and prerequisites
--

Solution

4. The CALL command is released for SAP-internal usage only and should not be used.
...

The easiest way to call an external program is to open a pipe using OPEN DATASET.

m@t
Posts: 4119
Joined: Thu Sep 04, 2003 7:37 am
Location: Switzerland

Post by m@t » Thu Apr 05, 2007 4:59 am

The €100 for five minutes is of course already heavily discounted.

It's probably best to use the SAP approved method of calling OS commands to the rename.

However, you could also read the file into an ABAP, write it out again under the new name, then delete the old file.

m@t
TULY Image The quality of answers is roughly proportional to the quality of the question.

The downside of being better than everyone else is that people tend to assume you're pretentious.

Ronster
Posts: 134
Joined: Thu Apr 14, 2005 3:07 am
Location: Holland

Post by Ronster » Thu Apr 05, 2007 5:08 am

I suggested the reading and saveing dataset method as well, but they want to prevent the dataload that comes along with it..

kgigi
Posts: 1
Joined: Wed Jun 13, 2007 5:12 am

old

Post by kgigi » Wed Jun 13, 2007 5:27 am

old release
Last edited by kgigi on Tue Mar 17, 2009 4:31 am, edited 4 times in total.

Ronster
Posts: 134
Joined: Thu Apr 14, 2005 3:07 am
Location: Holland

Post by Ronster » Wed Jun 13, 2007 7:43 am

Hi, thanks for your reply.

The program was not allowed to pump the file back and forth to an application server (frontend or whatever).
But I found a way to do it like they want it here.
I defined a new command in Transaction code SM69 . Since we're on windows (server) here, my operating system command is

Code: Select all

 CMD /C
In my ABAP I use function module

Code: Select all

SXPG_COMMAND_EXECUTE
to execute that command on the server and enter path and name and stuff.
So there you go: renaming the file ON server without reading it in memory first.
Cheers!

Ron.

Post Reply