Skip to Content
0
Former Member
May 16, 2007 at 04:38 AM

EDIT REGISTRY from ABAP

207 Views

Good morning to all,

I want to read the registry settings of the User's machine (presentation server) and edit the registry accordingly. Am using the following code but am getting Sy-subrc = 2 (control error).

Any suggestions will be highly appreciated.

Code snippet :

Data : CreationType_value type string.

CALL METHOD CL_GUI_FRONTEND_SERVICES=>REGISTRY_GET_VALUE

EXPORTING

ROOT = CL_GUI_FRONTEND_SERVICES=>HKEY_CURRENT_USER

KEY = 'Software\SAP\SAPLogon\Settings\System\Wizard'

VALUE = 'CreationType'

IMPORTING

REG_VALUE = CreationType_value

EXCEPTIONS

GET_REGVALUE_FAILED = 1

CNTL_ERROR = 2

ERROR_NO_GUI = 3

NOT_SUPPORTED_BY_GUI = 4

others = 5

.

WRITE / WorkOffline_value.

IF SY-SUBRC <> 0.

  • MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

  • WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

ENDIF.