09-10-2009 9:54 PM
I wanna call pc exe from abap, after calling can i get results from exe ?
09-10-2009 10:50 PM
Hi,
check this:
http://www.saptechies.com/ws_execute-to-called-external-program/
Use GUI_RUN instead of WS_EXECUTE.
Regards,
Subramanian
09-10-2009 10:45 PM
Go SM69, click create. Enter a command name 'ZZMYEXE', enter the path and the exe file name in operating system command field. You can call this exe from ABAP using SXPG_COMMAND_EXECUTE.
Please note that the exe has to exist on the server not on your PC or at least your PC (with fixed network address) should be accessable from server.
09-10-2009 10:50 PM
Hi,
check this:
http://www.saptechies.com/ws_execute-to-called-external-program/
Use GUI_RUN instead of WS_EXECUTE.
Regards,
Subramanian
09-11-2009 3:38 AM
Hi,
Try this way.
Thanks
Venkat.O
REPORT ZTEST_NOTEPAD.
CALL METHOD CL_GUI_FRONTEND_SERVICES=>EXECUTE
EXPORTING
APPLICATION = 'C:\Program Files\Easy GIF Animator\gifan.exe'
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.
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
09-11-2009 8:30 AM
thanks your responses . but i dont want operating system messages. I wanna see that for example ..
i am calling dos command dir ..
result lists all of content of directory ..
like this .. i wanna execute a pc exe and i wanna take result from exe .. can u help me ?
09-11-2009 9:07 AM
Hi,
for dos DIR you can use:
DATA: COUNT TYPE I.
*
DATA: WA_TAB_FILE TYPE FILE_INFO,
TAB_FILE TYPE TABLE OF FILE_INFO.
*
CALL METHOD CL_GUI_FRONTEND_SERVICES=>DIRECTORY_LIST_FILES
EXPORTING
DIRECTORY = 'C:\'
FILTER = '*'
CHANGING
FILE_TABLE = TAB_FILE
COUNT = COUNT.
*
write: / 'count of files:', count.
*
LOOP AT TAB_FILE INTO WA_TAB_FILE.
*
WRITE: / WA_TAB_FILE-FILENAME(40),
WA_TAB_FILE-FILELENGTH,
WA_TAB_FILE-CREATEDATE,
WA_TAB_FILE-ISDIR.
*
ENDLOOP.
in CL_GUI_FRONTEND_SERVICES=>DIRECTORY_LIST_FILES there are more posibilities.
If you have another EXE on PC. Put the output of EXE in an FILE and read thie file via CL_GUI_FRONTEND_SERVICES.
Regards, Dieter