Quantcast
Channel: SCN : Unanswered Discussions - SAP GUI
Viewing all articles
Browse latest Browse all 2552

Write New Entry in Windows Registry

$
0
0

Hello community,

 

the following routine delivers always 1. It is no matter if the entry is written to the Windows registry or not, rc is always 1.

 

"-Begin-----------------------------------------------------------------
  Program ZTEST.

    "-Variables---------------------------------------------------------
      Data rc Type i.

    PerForm CreateKey Using 'Software\Classes\Test' '' '' Changing rc.

"-End-------------------------------------------------------------------

"-Subroutines begin-----------------------------------------------------

  "-Function CreateKey--------------------------------------------------
    Form CreateKey Using SubKey Type String ValueName Type String
      Value Type String Changing rc Type i.

      Call Method cl_gui_frontend_services=>registry_set_value
        Exporting
          root = cl_gui_frontend_services=>hkey_current_user
          key = SubKey
          value_name = ValueName
          value = Value
        Importing
          rc = rc
        Exceptions
          registry_error = 1

          cntl_error
= 2
          error_no_gui = 3
          not_supported_by_gui = 4
          Others = 5.

      Call Method cl_gui_cfw=>flush.

    EndForm.

"-Subroutines end-------------------------------------------------------

Is it correct?

 

Thanks for hints and tips.

 

Cheers

Stefan


Viewing all articles
Browse latest Browse all 2552

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>