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

GUI_GET_REGVALUE - REGISTRY_ERROR

Kanagaraja_L
Active Contributor
0 Likes
1,149

Hi All,

I am trying to get Cookies file path through Windows Registry(REGEDIT), using following function Module

DATA:lv_key(255) VALUE
'SOFTWARE\MiCROSOFT\WINDOWS\CURRENTVERSION\EXPLORER\SHELL FOLDERS',
     lv_root TYPE i value '1',
     lv_value_name(255) VALUE 'Cookies',
     lv_string(255) value  '<MISSING>'.
*
CALL FUNCTION 'GUI_GET_REGVALUE'
     EXPORTING
          root           = lv_root
          key            = lv_key
          value_name     = lv_value_name
     CHANGING
          string         = lv_string
     EXCEPTIONS
          registry_error = 1
          OTHERS         = 2.

I am getting file path, when execute in SAP GUI (4.6C) but I am getting REGISTRY_ERROR, when execute in ITS environment.

Kindly suggest. Appriciate your help

Kanagaraja Lokanathan

1 ACCEPTED SOLUTION
Read only

Clemenss
Active Contributor
0 Likes
1,076

Hi,

try to flush after call:

DATA:lv_key(255) VALUE
'SOFTWARE\MiCROSOFT\WINDOWS\CURRENTVERSION\EXPLORER\SHELL FOLDERS',
     lv_root TYPE i value '1',
     lv_value_name(255) VALUE 'Cookies',
     lv_string(255) value  '<MISSING>'.
*
CALL FUNCTION 'GUI_GET_REGVALUE'
     EXPORTING
          root           = lv_root
          key            = lv_key
          value_name     = lv_value_name
     CHANGING
          string         = lv_string
     EXCEPTIONS
          registry_error = 1
          OTHERS         = 2.
CL_GUI_CFW=>FLUSH( ).

The flush does the synchronization between GUI frontend and SAP server backend. After flush lv_string will get value.

Regards,

Clemens

Sorry, nonsense - did not read thoroughly. But it has been said: No GUI function without SAPGUI.

You can get the registry value only if your ITS server runs on a windows server, but then via OS command.

Edited by: Clemens Li on Dec 30, 2010 8:39 PM

4 REPLIES 4
Read only

Former Member
0 Likes
1,076

Hi,

Please check the Key , I think this should not be in all CAPS .

'Software\Microsoft\Windows\CurrentVersion\Explorer\ShellFolders'

Regards,

Srini.

Read only

0 Likes
1,076

Hi Srini,

Thank You

I tried with your suggestion but it is not working.

Kanagaraja Lokanathan

Read only

0 Likes
1,076

GUI_GET_REGVALUE is only supported in SAPGUI environment. You can't use it under ITS.

Read only

Clemenss
Active Contributor
0 Likes
1,077

Hi,

try to flush after call:

DATA:lv_key(255) VALUE
'SOFTWARE\MiCROSOFT\WINDOWS\CURRENTVERSION\EXPLORER\SHELL FOLDERS',
     lv_root TYPE i value '1',
     lv_value_name(255) VALUE 'Cookies',
     lv_string(255) value  '<MISSING>'.
*
CALL FUNCTION 'GUI_GET_REGVALUE'
     EXPORTING
          root           = lv_root
          key            = lv_key
          value_name     = lv_value_name
     CHANGING
          string         = lv_string
     EXCEPTIONS
          registry_error = 1
          OTHERS         = 2.
CL_GUI_CFW=>FLUSH( ).

The flush does the synchronization between GUI frontend and SAP server backend. After flush lv_string will get value.

Regards,

Clemens

Sorry, nonsense - did not read thoroughly. But it has been said: No GUI function without SAPGUI.

You can get the registry value only if your ITS server runs on a windows server, but then via OS command.

Edited by: Clemens Li on Dec 30, 2010 8:39 PM