SQL Server administration and T-SQL development, Web Programming with ASP.NET, HTML5 and Javascript, Windows Phone 8 app development, SAP Smartforms and ABAP Programming, Windows 7, Visual Studio and MS Office software
Development resources, articles, tutorials, code samples, tools and downloads for SAP HANA and ABAP, HANA Database, SQLScript, SAP UI5, Screen Personas, Web Dynpro, Workflow

Read Registry Data in ABAP Code using Class Methods

To read Windows registry key values, SAP ABAP programmers can use build-in ABAP class method cl_gui_frontend_services=>registry_get_value. In this ABAP tutorial, I want to show a demo code where list separator character is fetched from Windows Registry by ABAP code with mentioned ABAP class method cl_gui_frontend_services=>registry_get_value

For example, assume that ABAP developer requires to read sList key value for list separator character which is stored under following registry path:
\HKEY_CURRENT_USER\Control Panel\International

read registry data in ABAP using class methods

In order to read registry key sList from Windows Registry, ABAP programmer can use cl_gui_frontend_services=>registry_get_value class method by configuring the input parameters as in following code block.

CALL METHOD cl_gui_frontend_services=>registry_get_value
  root = cl_gui_frontend_services=>hkey_current_user
  key = 'Control Panel\International'
  value = 'sList'
  reg_value = DATA(lv_seperator)
  get_regvalue_failed = 1
  cntl_error = 2
  error_no_gui = 3
  not_supported_by_gui = 4
  OTHERS = 5.

After class method cl_gui_frontend_services=>registry_get_value is called, registry value is returned in local variable lv_seperator which is declared in-line and has string data type.

Just to note, ABAP programmer can read Windows registry sDecimal key value and sThousand key value for decimal separator and thousand separator characters using above static class method.


Install SAP Free
CRM Companies List
Web Based CRM Software

Copyright © 2004 - 2021 Eralper YILMAZ. All rights reserved.