‎2010 Mar 09 6:01 AM
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
‎2010 Mar 09 6:20 AM
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
‎2010 Mar 09 10:20 AM
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.
‎2010 Mar 09 10:27 AM
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
‎2010 Mar 10 12:48 PM
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
‎2010 Mar 10 6:15 AM
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.
.