Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

alternative for GUI_GET_REGVALUE ??

Former Member
0 Likes
452

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

1 REPLY 1
Read only

Former Member
0 Likes
395

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