15
Jul
ABAP Program to Execute a DOS command from SAP
Posted by Admin, under ABAP, Function Modules, Sample CodeThis sample program demonstrate the execution of DOS command from SAP.
To execute a dos command from ABAP, you need to create a bat file.
Use the windows notepad to create this bat file c:\test.bat with content:-
test.batc:\cd\tempdir /p
REPORT ZDOSCOMMAND NO STANDARD PAGE HEADING.
PARAMETERS: DOSCMD(30) DEFAULT ‘c:\test.bat’ LOWER CASE.
CALL method cl_gui_frontend_services=>execute
EXPORTING
DOCUMENT = DOSCMD.
“End of program
You might also be interested in these posts:

Please note that the function module is obsolete
Thanx for the correct update Kalyan.
The function is now an absolute from version 4.7 onwards.
I will update the post itself.
Post a Comment