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

cl_gui_frontend_services execute exceptions

Former Member
0 Likes
2,018

Hi everyone

I have 2 questions related to the method cl_gui_frontend_services=>execute :

DATA: w_param TYPE String.

w_param =  'C:\TMP\NewOutput'.

CALL METHOD cl_gui_frontend_services=>execute
  EXPORTING
    document = w_param

  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 = 0.

Questions:

1. Is it possible to have a list of file extention supported?

2. When the file extention is not supported, can we avoid windows to display the error message and have the exception FILE_EXTENTION_UNKNOWN set?

    

Regards

Daniel

1 ACCEPTED SOLUTION
Read only

RaymondGiuseppi
Active Contributor
0 Likes
1,278

Try to use method CL_GUI_FRONTEND_SERVICES->REGISTRY_GET_VALUE() or REGISTRY_GET_DWORD_VALUE to get the list of file extensions/validate an extension managed by Windows on current workstation.

example:

In your case, there is no extension, so ...

Regards,

Raymond

3 REPLIES 3
Read only

RaymondGiuseppi
Active Contributor
0 Likes
1,279

Try to use method CL_GUI_FRONTEND_SERVICES->REGISTRY_GET_VALUE() or REGISTRY_GET_DWORD_VALUE to get the list of file extensions/validate an extension managed by Windows on current workstation.

example:

In your case, there is no extension, so ...

Regards,

Raymond

Read only

0 Likes
1,278

Hello Raymond

Thank you for your response.

That doesn't give a list of supported extension but at least we can have an idea if the extension is supported or not.

One more question:

If the extension is not supported, I would like to ask the user to select with which software he want to open the file. Like windows does.

Any idea if it is possible to do it through ABAP?

Regards

Daniel

Read only

0 Likes
1,278

You have to run the OS command, firstly you have to identify which windows command calls that screen, then you can run OS command following this post https://scn.sap.com/thread/1014193

Regards,

Felipe