‎2007 Jan 05 5:53 AM
I am trying to execute a dos command thru sap and specific the delete command.
i tried in 2 ways (i read it to the forum) but i can't do it.
a) DATA : FILE(100),
PARAM(50),
COMM(30).
COMM = 'DEL.COM'.
CONCATENATE 'C:\' 'A.TXT' INTO FILE.
CALL FUNCTION 'GUI_RUN'
EXPORTING
COMMAND = COMM
PARAMETER = FILE.
b) CALL METHOD cl_gui_frontend_services=>execute
EXPORTING
DOCUMENT = 'C:\A.TXT'
application = 'YDEL'
parameter = 'C:\A.TXT'
DEFAULT_DIRECTORY =
MAXIMIZED = 'X'
MINIMIZED =
SYNCHRONOUS =
OPERATION = 'OPEN'
EXCEPTIONS
cntl_error = 1
error_no_gui = 2
bad_parameter = 3
file_not_found = 4
path_not_found = 5
file_extension_unknown = 6
error_execute_failed = 7
synchronous_failed = 8
not_supported_by_gui = 9
OTHERS = 10.
Please help me ...
‎2007 Jan 05 6:13 AM
i tried but it doesn't work . It open a dos window with the cmd command but later it doesn't do anything . Which way you tried ?
What did you wrote ?
‎2007 Jan 05 6:06 AM
Hi dimath,
1. I just tried, and now it works.
2. give like this. (we have to use CMD as the command and not DEL)
3.
<b>COMMAND = CMD
PARAMETER = DEL D:\ABC.TXT</b>
regards,
amit m.
‎2007 Jan 05 6:13 AM
i tried but it doesn't work . It open a dos window with the cmd command but later it doesn't do anything . Which way you tried ?
What did you wrote ?
‎2007 Jan 05 6:33 AM
Hi dimath,
1. sorry, now this will work.
(this will not even open the dos window)
(it will get opened only for a fraction of seconds, and then get closed automatically)
the file will get deleted.
2.
command = CMD
parameter = /C DEL D:\AA.TXT
(note /C is important)
regards,
amit m.