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

problem cl_gui_frontend_services=>execute when folder has space

sawanee_aimsaard
Explorer
0 Likes
2,353

Hi Experts,

I use "execute method" in "cl_gui_frontend_services class" for encrypting my text file. it is working when folder does not have space

lv_param = 'C:\Users\myname\Desktop\PA\File.txt'.
lv_default = 'C:\Users\myname\Desktop\PA\'.

CALL METHOD cl_gui_frontend_services=>execute 
     EXPORTING 
        application = 'C:\EncryptFile.jar' 
        parameter = lv_param 
        default_directory = lv_default 
        maximized = '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.

This code is working.

If My folder has space as code below ('C:\Users\myname\Desktop\P A\File.txt'). It is not working

There is space between "P" and "A"

lv_param = 'C:\Users\myname\Desktop\P A\File.txt'.
lv_default = 'C:\Users\myname\Desktop\P A\'.

CALL METHOD cl_gui_frontend_services=>execute 
     EXPORTING 
        application = 'C:\EncryptFile.jar' 
        parameter = lv_param 
        default_directory = lv_default 
        maximized = '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.

What can I do for solving this problem when my folder has space?

1 ACCEPTED SOLUTION
Read only

jmodaal
Active Contributor
1,947

Hello,

use quotation marks ("...").

It should work this way:

lv_param ='"C:\Users\myname\Desktop\P A\File.txt"'.
lv_default ='"C:\Users\myname\Desktop\P A\"'.
2 REPLIES 2
Read only

jmodaal
Active Contributor
1,948

Hello,

use quotation marks ("...").

It should work this way:

lv_param ='"C:\Users\myname\Desktop\P A\File.txt"'.
lv_default ='"C:\Users\myname\Desktop\P A\"'.
Read only

0 Likes
1,947

Thank you so much 🙂