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 with cl_gui_frontend_services execute method

Former Member
0 Likes
3,266

Halo experts ,

I am facing a peculiar problem with cl_gui_frontend_services execute .

I am trying to open documents using the method execute of cl_gui_frontend_services

. But the problem is it is not opening file with space in its name .

ie it is able to open 'for_example.pdf' but not 'for example.pdf'

Any one has idea why it is happening?

Regards

Arshad

5 REPLIES 5
Read only

alex_cook
Active Participant
0 Likes
1,341

Hi,

What operating system is your client? I tested the method on Windows XP and it seems to work fine with a space in the name.

You can also try putting double quotes around the path + filename.

Cheers

Alex

Read only

Former Member
0 Likes
1,341

Halo Alex,

I am in Windows Xp operating system only.

See below my code

l_application = 'ACRORD32.EXE'.

CALL METHOD cl_gui_frontend_services=>execute

EXPORTING

application = l_application

parameter = 'L11527110.pdf'

default_directory = 'M:\Documents and Settings\Arshad\My Documents\'

maximized = '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.

It is working for the above but if the parameter name is L 11527110.pdf it is just opening the Acrobat and a pop up message says cannot find the Document.

I tried giving the Document path with the application the method is returning exception bad parameter.

Read only

Former Member
0 Likes
1,341

Hi,

I think this is a GUI problem. Which version & patch of SAP GUI are you currently using. This can be found out from your SAP LOGON pad by clicking the top left corner button -> About SAP Logon.

Thanks

Mani

Read only

Clemenss
Active Contributor
0 Likes
1,341

Hi Arshad,

you may try to copy the file name, not to type it.

If the file is not found with the name you give then probably the name is different. Computers are able to distinguisj between one and two spaces.

Regards,

Clemens

Read only

Former Member
0 Likes
1,341

HI Arshad...

This does not seems to be a problem of GUI...

bad parameter exceptions is coming ... mean you are passing an incorrect parameter ...mean incorrect file name ...or the filename you are passing does not exits in you my documents folder ...

I have executed the same code ... and it is perfectly working fine ... you have to pass the file name exactly ... that means if

you are passing L11527110.pdf then the file name should be L11527110.pdf...

if you are passing the parameter as L 11527110.pdf (* with space ) then the file name has to be exactly same ... other wise ...

the application ACRORD32.EXE opens but gives as error ...

please check the file name in my docs and passing parameter value ....

I am giving my code which i did .....




CALL METHOD cl_gui_frontend_services=>execute
EXPORTING
application ='ACRORD32.EXE'
parameter = 'B CDWBDIC.pdf'
default_directory = 'C:\Documents and Settings\Ritamadmin\My Documents\'
maximized = '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.

.