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: 

CALL METHOD cl_gui_frontend_services=>execute???

Former Member
0 Kudos

Hi to all..while reading some of the posted message, I have found the below code which is really working.

Now, my question is, how can I or can I redirect or change the source directory 'c:\mypic.gif'(which is my local dir) into sap server directory?

The sap server directory bitmap files, the one I uploaded from SE78 and I want to print it by the below code.

Pls help. Thanks.

DATA: lv_parameter TYPE string.

CONCATENATE '"' 'c:\mypic.gif' '"' INTO lv_parameter.

CONCATENATE '/p' lv_parameter INTO lv_parameter SEPARATED BY space.

CALL METHOD cl_gui_frontend_services=>execute

EXPORTING

application = 'c:\windows\system32\mspaint.exe'

parameter = lv_parameter

synchronous = 'X'

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.

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Hi,

In order to use a file located on the application server with the gui execute method, I'm afraid you will have to either map your server drive to a local drive first or copy the file locally before using it....

Kr,

Manu.

3 REPLIES 3

Former Member
0 Kudos

Hi,

data: fnam type string,

ftabnam type FILETABLE,

RC TYPE I VALUE 1.

CALL METHOD CL_GUI_FRONTEND_SERVICES=>FILE_OPEN_DIALOG "here we are using this method to select file at runtime.

EXPORTING

WINDOW_TITLE = 'TO SELECT FILE IN RUNTIME'

  • DEFAULT_EXTENSION =

  • DEFAULT_FILENAME =

  • FILE_FILTER =

  • WITH_ENCODING =

  • INITIAL_DIRECTORY =

  • MULTISELECTION =

CHANGING

FILE_TABLE = ftabnam

RC = RC

  • USER_ACTION =

  • FILE_ENCODING =

EXCEPTIONS

FILE_OPEN_DIALOG_FAILED = 1

CNTL_ERROR = 2

ERROR_NO_GUI = 3

NOT_SUPPORTED_BY_GUI = 4

others = 5

.

IF SY-SUBRC EQ 0.

READ TABLE FTABNAM INTO FNAM INDEX RC.

ENDIF.

regards,

Ravi

Former Member
0 Kudos

Hi,

Please try this code .Hope it works.

Hi,

lv_parameter = 'your directory path of bitmap image' .

CONCATENATE '/p' lv_parameter INTO lv_parameter SEPARATED BY space.

CALL METHOD cl_gui_frontend_services=>execute

EXPORTING

application = 'c:\windows\system32\mspaint.exe'

*parameter = lv_file_name

DEFAULT_DIRECTORY = lv_parameter

synchronous = 'X'

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.

Former Member
0 Kudos

Hi,

In order to use a file located on the application server with the gui execute method, I'm afraid you will have to either map your server drive to a local drive first or copy the file locally before using it....

Kr,

Manu.