‎2009 Sep 24 12:10 PM
Hi All,
We are going for upgrade from 4.6 to ECC 6.0.Function module REGISTRY_GET is obselete in 4.6 instead of this i have used class CL_GUI_FRONTEND_SERVICES method 'registry_get_value' .But the there is a diffrence in number of parameter passed in function module and that class method.Below is the code both in 4.6 and ECC 6.0.
In 4.6 it was as below:
CALL FUNCTION 'REGISTRY_GET'
EXPORTING
KEY = 'protocol\StdFileEditing\server'
SECTION = 'ExcelWorksheet'
IMPORTING
VALUE = EXCEL_PATH.
Now in ECC 6.0 i replaced as below:
call method cl_gui_frontend_services=>registry_get_value
exporting
root = cl_gui_frontend_services=>hkey_classes_root
key = 'protocol\StdFileEditing\server'
value = ''
importing
reg_value = reg_value
exceptions
get_regvalue_failed = 1
cntl_error = 2
error_no_gui = 3
others = 4.
If i compair both the code then parameters differ's.But i am not able to undestand what the use of these parameter.Please sugest if i am doing the right thing in ECC6.0 and please also let me know the replacement of function module 'Profile_GET' used as below in 4.6:
call function 'PROFILE_GET'
exporting
filename = 'front.ini'
key = 'Path'
section = 'Filetransfer'
importing
value = dir_path
exceptions
others = 1.
Thanks
Mohit
‎2009 Sep 24 12:20 PM
Sample to understand :
Code 46C
* Test, ob OrgPublisher lokal installiert ist
CALL FUNCTION 'REGISTRY_GET'
EXPORTING
key = 'CLSID'
section = 'OrgPublisher.Document.2'
IMPORTING
value = class_id.
IF class_id IS INITIAL.
Code ECC 6.0
CALL METHOD cl_gui_frontend_services=>registry_get_value
EXPORTING
root = cl_gui_frontend_services=>hkey_classes_root
key = 'OrgPublisher.Document.2\CLSID'
IMPORTING
reg_value = class_id
EXCEPTIONS
get_regvalue_failed = 1
cntl_error = 2
error_no_gui = 3
not_supported_by_gui = 4
OTHERS = 5.
CALL METHOD cl_gui_cfw=>flush
EXCEPTIONS
cntl_system_error = 1
cntl_error = 2
OTHERS = 3.
IF class_id IS INITIAL OR sy-subrc NE 0.Regards,
Raymond
‎2009 Sep 24 12:20 PM
Sample to understand :
Code 46C
* Test, ob OrgPublisher lokal installiert ist
CALL FUNCTION 'REGISTRY_GET'
EXPORTING
key = 'CLSID'
section = 'OrgPublisher.Document.2'
IMPORTING
value = class_id.
IF class_id IS INITIAL.
Code ECC 6.0
CALL METHOD cl_gui_frontend_services=>registry_get_value
EXPORTING
root = cl_gui_frontend_services=>hkey_classes_root
key = 'OrgPublisher.Document.2\CLSID'
IMPORTING
reg_value = class_id
EXCEPTIONS
get_regvalue_failed = 1
cntl_error = 2
error_no_gui = 3
not_supported_by_gui = 4
OTHERS = 5.
CALL METHOD cl_gui_cfw=>flush
EXCEPTIONS
cntl_system_error = 1
cntl_error = 2
OTHERS = 3.
IF class_id IS INITIAL OR sy-subrc NE 0.Regards,
Raymond
‎2009 Sep 24 12:44 PM
Second sample to understand :
Code 46C
CALL FUNCTION 'PROFILE_GET'
EXPORTING
filename = 'front.ini'
key = 'Path'
section = 'Filetransfer'
IMPORTING
value = path.Code ECC 6.0
CALL FUNCTION 'GUI_GET_REGVALUE'
EXPORTING
ROOT = 2
KEY = 'software\sap\sap shared'
VALUE_NAME = 'sapworkdir'
CHANGING
STRING = path
EXCEPTIONS
REGISTRY_ERROR = 1
OTHERS = 2.Regards,
Raymond
‎2009 Sep 24 2:20 PM
Hi ,
Thanks for your help.I have one more query where i should pass value of 'section = 'Filetransfer'. in below function module:
CALL FUNCTION 'GUI_GET_REGVALUE'
EXPORTING
ROOT = 2
KEY = 'software\sap\sap shared'
VALUE_NAME = 'sapworkdir'
CHANGING
STRING = path
EXCEPTIONS
REGISTRY_ERROR = 1
OTHERS = 2.
Thanks
mohit
‎2009 Sep 24 5:43 PM
"Filetransfer'" has become "'sapworkdir", if found it initially within a SAP OSS note that corrected one of their program which used the obsolete function module.
Regards,
Raymond
PS: note found (again) [Note 966310 - Local copies of documents not in SapWorkDir|https://service.sap.com/sap/support/notes/966310] read the source correction for the FORM GET_DISPLAY_DIR. (applicable since 46C...)
Edited by: Raymond Giuseppi on Sep 24, 2009 6:45 PM
‎2009 Sep 25 10:05 AM
Hi Raymond,
Thanks for your help.I have seen this note but i believe it's applicable till 4.6 only.Shaii i go ahead with correction in ECC 6.0 with using ''GUI_GET_REGVALUE' function module instead of 'Profile_GET'.
Thanks
Mohit