2009 Jul 10 2:21 PM
I noticed that GUI_GET_REGVALUE is set to obsolete.
so I try to avoid using this function if there is an alternative at hand.
I only have the problem that when I use the registry_get_value in a programm which controls the printpreview from me22n that I het the exception cntl_error.
If I use the same code in a small sample program that stands on its own then the code works perfectly and returns the path I want.
is there a way to make this method work inside a sap programm or do I have to use the obsolete function GUI_GET_REGVALUE
in these cases ??
CALL METHOD cl_gui_frontend_services=>registry_get_value
EXPORTING
root = '1'
key = 'Software\SAP\SAPGUI Front\SAP Frontend Server\LocalData'
value = 'DataPath'
IMPORTING
reg_value = h_pad
EXCEPTIONS
get_regvalue_failed = 1
cntl_error = 2
error_no_gui = 3
not_supported_by_gui = 4
others = 5
.
IF sy-subrc <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
* WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.kind regards
arthur
I noticed that GUI_GET_REGVALUE is set to obsolete.
so I try to avoid using this function if there is an alternative at hand.
I only have the problem that when I use the registry_get_value in a programm which controls the printpreview from me22n that I het the exception cntl_error.
If I use the same code in a small sample program that stands on its own then the code works perfectly and returns the path I want.
is there a way to make this method work inside a sap programm or do I have to use the obsolete function GUI_GET_REGVALUE
in these cases ??
CALL METHOD cl_gui_frontend_services=>registry_get_value
EXPORTING
root = '1'
key = 'Software\SAP\SAPGUI Front\SAP Frontend Server\LocalData'
value = 'DataPath'
IMPORTING
reg_value = h_pad
EXCEPTIONS
get_regvalue_failed = 1
cntl_error = 2
error_no_gui = 3
not_supported_by_gui = 4
others = 5
.
IF sy-subrc <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
* WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.kind regards
arthur
2009 Jul 14 2:53 PM
I put above code in a function and now it also works in the print control extension of me22n
kind regards
arthur
Edited by: A. de Smidt on Jul 15, 2009 2:49 PM