Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Calling Executable File

former_member194669
Active Contributor
0 Likes
735

Hi,

I have a PDF to TXT third party executable file in the application server, I need to call this exe thru my program.

My requirement is to call this exe file and open a PDF file and convert the

PDF to TXT and write the output TXT file into application servier.

is it possible thru ABAP?

Thanks

aRs

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
677

Hi

You can use the class <b>cl_gui_frontend_services</b>

Please see the following command

appl = 'cmd'.

param = '/c ipconfig /all>c:\temp\ipconfig.txt'.

call method cl_gui_frontend_services=>execute

exporting

  • DOCUMENT = appl

application = appl

parameter = param

  • DEFAULT_DIRECTORY =

  • MAXIMIZED =

  • MINIMIZED =

synchronous = 'X'

  • 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

.

5 REPLIES 5
Read only

michael-john_turner
Active Participant
0 Likes
677

Assuming you can pass the executable the source and target filenames as parameters, it's pretty easy. Define an external command in SM69 that calls the executable and then call that from your code using one of the function modules in function group SXPT (eg SXPG_COMMAND_EXECUTE).

MJ

Read only

Former Member
0 Likes
677

Hi ars,

1. we can use GUI_EXEC

2. in that we can give the full path of the .EXE file.

regards,

amit m.

Read only

Former Member
0 Likes
677

You call other applications through the EXECUTE method of CL_GUI_FRONTEND_SERVICES for this task, but not sure how far this can do the rest of your requirements.

Regards

Kathirvel

Read only

Former Member
0 Likes
677

To execute an exe file you can use the class=> method:

CL_GUI_FRONTEND_SERVICES=>EXECUTE

or you can define an external od command as other have already mentioed.

http://help.sap.com/saphelp_erp2005/helpdata/en/c4/3a8023505211d189550000e829fbbd/frameset.htm

Regards,

Ravi

Read only

Former Member
0 Likes
678

Hi

You can use the class <b>cl_gui_frontend_services</b>

Please see the following command

appl = 'cmd'.

param = '/c ipconfig /all>c:\temp\ipconfig.txt'.

call method cl_gui_frontend_services=>execute

exporting

  • DOCUMENT = appl

application = appl

parameter = param

  • DEFAULT_DIRECTORY =

  • MAXIMIZED =

  • MINIMIZED =

synchronous = 'X'

  • 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

.