Application Development 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: 

calling exe file.

Former Member
0 Kudos

Hi,

I am working on the Automatic payment transaction(f110).

while using this transaction i have to call the eft.bat file so that it can encrypt the file so that we can send this file to bank. issue is the place where im calling the eft.bat file is running in the background and when eftbat is being called it runs in the foreground .so in this case it throws the dump.

please any body can suggest how should i call any program

while running in the background and called third party program should also run in the background.

regards,

Ronie

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Hai Ronie

WS_EXECUTE was Absolote in Higher versions

Try with the following Class & Methods

DATA: L_APP TYPE STRING.

L_APP = i_file.

CALL METHOD CL_GUI_FRONTEND_SERVICES=>EXECUTE

EXPORTING

  • DOCUMENT =

APPLICATION = L_APP

PARAMETER = 'c:\temp\lgsmain'

  • DEFAULT_DIRECTORY =

  • MAXIMIZED =

  • 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

.

IF SY-SUBRC <> 0.

  • MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

  • WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

ENDIF.

Thanks & regards

Sreenivasulu P

Message was edited by: Sreenivasulu Ponnadi

12 REPLIES 12

Former Member
0 Kudos

Hi,

Try calling the method EXECUTE of the class CL_GUI_FRONTEND_SERVICES to execute the file. Or the function module WS_EXECUTE.

Regards

Ravi

Note : Please mark the helpful answers

former_member188685
Active Contributor
0 Kudos

Hi,

try to call the FM <b>WS_EXECUTE</b>

Regards

vijay

0 Kudos

Hi,

I have used all these but situation remains the same.

CALL METHOD cl_gui_frontend_services=>execute

GUI_EXEC Replaces WS_EXECUTE. Start a File or Program Asynchronously with WinExec

GUI_RUN Start a File or Program Asynchronously with ShellExecute

WS_EXECUTE execute a program on a windows PC

regards,

Ronie

0 Kudos

hi ,

i am using this!!

CALL METHOD cl_gui_frontend_services=>execute

EXPORTING

  • DOCUMENT =

APPLICATION = 'c:\eft\startup.bat'

  • PARAMETER =

  • DEFAULT_DIRECTORY =

  • MAXIMIZED =

  • 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

.

IF sy-subrc <> 0.

  • MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

  • WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

ENDIF.

regards,

Ronie

0 Kudos

Hi Ronie,

if you are running the Program in BACKGROUND none of them will work. since all of them will use Frontend. in BAckground it is not possible.

Regards

vijay

Former Member
0 Kudos

Hai Ronie

WS_EXECUTE was Absolote in Higher versions

Try with the following Class & Methods

DATA: L_APP TYPE STRING.

L_APP = i_file.

CALL METHOD CL_GUI_FRONTEND_SERVICES=>EXECUTE

EXPORTING

  • DOCUMENT =

APPLICATION = L_APP

PARAMETER = 'c:\temp\lgsmain'

  • DEFAULT_DIRECTORY =

  • MAXIMIZED =

  • 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

.

IF SY-SUBRC <> 0.

  • MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

  • WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

ENDIF.

Thanks & regards

Sreenivasulu P

Message was edited by: Sreenivasulu Ponnadi

Former Member
0 Kudos
This is an example to open pdf file

CALL METHOD cl_gui_frontend_services=>execute
EXPORTING
* DOCUMENT =
APPLICATION = 'AcroRd32.exe'
PARAMETER = 'C:MY_FILE.PDF'
* DEFAULT_DIRECTORY =
* MAXIMIZED =
* 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
.
IF sy-subrc <> 0.
ENDIF.

abdul_hakim
Active Contributor
0 Kudos

hi ronie,

you cannot use the method CL_GUI_FRONTEND_SERVICES=>EXECUTE for calling an object in the background...

Cheers,

Abdul

0 Kudos

hi,

so what should i do to do this any work around for this.

this is really urgent!!!

regards,

Ronie.

0 Kudos

Try creating a OS command in SM69 for the batch file and execute that command using the function SXPG_COMMAND_EXECUTE. I think this will execute in background as well.

Regards,

Ravi

Former Member
0 Kudos

You can create an external job with transaction SM36. I have run a Unix shell script with this method.

Former Member
0 Kudos

The print programs in F110 run in the background. There is no way to call an exe on the frontend from a background job.

There are two options here:

1. Run the print program manually (ie create a transaction or from SA38). It will then run in the foreground and GUI_EXECUTE will work.

2. Run the encryption program on the application server.

Solution 2 is better, as running an encryption on the workstation is not good security.

Michael