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: 

File Open Dialog - no extension

michael_calekta
Explorer
0 Kudos
872

Hi,

This might be a tricky one:

I use the method cl_gui_frontend_services=>file_open_dialog( ) for file-upload, to let the user choose a file from their desptp. And this works just fine for most users, but some of them have their windows-folders set up, that they don't display file-extensions. In that case, the Method file_open_dialog( ) delivers no extension, and the file can therefore not be uploaded.

Is there any way, that before starting the file_open_dialog( ) I can force Windows to set the folder-display correctly? E.g. by calling some Windows-DLLs by SAP, that set the folder-display to "with file-extensions"?

(Trouble is, I can't be sure which file-format the users select, as they can choose between Word, Excel or PDF. Else it would be easy to add the extension, if it's missing, but here this is no solution)

1 ACCEPTED SOLUTION

RaymondGiuseppi
Active Contributor
796

You could set the register values

  • HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced - HideFileExt set to 0
  • Look at methods such as CL_GUI_FRONTEND_SERVICES=>REGISTRY_GET_VALUE and SET_VALUE

Nevertheless, check the OSS notes for your version (SAP and SAPGUI patches) as I've never had this case?

4 REPLIES 4

RaymondGiuseppi
Active Contributor
797

You could set the register values

  • HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced - HideFileExt set to 0
  • Look at methods such as CL_GUI_FRONTEND_SERVICES=>REGISTRY_GET_VALUE and SET_VALUE

Nevertheless, check the OSS notes for your version (SAP and SAPGUI patches) as I've never had this case?

796

@ other people, for information, the list of all SAP GUI registration keys are listed in the SAP GUI Administration Guide (I didn't check for this specific key, but the guide contains many ones).

holm
Participant
796

In SAPGUI 8.0 this is not the case. I would take a look at version and PL of your SAPGUI.

michael_calekta
Explorer
796

Thank you very much!
This is the solution I needed! The value though is a DWORD, so I had to use the Method REGISTRY_SET_DWORD_VALUE, but else it's exactly what I was looking for. So no matter what the user has set in his Windows-Explorer-Settings I will get the needed File-extension delivered now.

Great!

(The SAP and GUI-Patches are all fine - thanks - it's just that you have to take care of different types of users)