ABAP Program to Execute a DOS command from SAP

2
435

This 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

2 COMMENTS

  1. Thanx for the correct update Kalyan.
    The function is now an absolute from version 4.7 onwards.
    I will update the post itself.

LEAVE A REPLY

Please enter your comment!
Please enter your name here