Skip to Content
avatar image
Former Member

calling exe file.

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

Add comment
10|10000 characters needed characters exceeded

  • Follow
  • Get RSS Feed

7 Answers

  • avatar image
    Former Member
    May 09, 2006 at 11:15 AM

    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

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    May 09, 2006 at 11:03 AM

    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

    Add comment
    10|10000 characters needed characters exceeded

  • May 09, 2006 at 11:07 AM

    Hi,

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

    Regards

    vijay

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    May 09, 2006 at 11:26 AM
    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.
    Add comment
    10|10000 characters needed characters exceeded

  • May 09, 2006 at 11:31 AM

    hi ronie,

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

    Cheers,

    Abdul

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member Former Member

      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

  • avatar image
    Former Member
    May 11, 2006 at 01:21 PM

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

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    May 12, 2006 at 05:44 AM

    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

    Add comment
    10|10000 characters needed characters exceeded