CALL METHOD cl_gui_cfw=>flush. IF NOT server IS INITIAL. SPLIT server AT ':' INTO p_host p_port. ENDIF.
AT SELECTION-SCREEN. IF sy-ucomm = 'ONLI' AND NOT p_host IS INITIAL. matcher = cl_abap_matcher=>create( pattern = '\d+\.\d+\.\d+\.\d+' ignore_case = 'X' text = p_host ). IF matcher->match( ) IS INITIAL. MESSAGE 'Wrong IP Addr Format' TYPE 'E'. ENDIF. ENDIF.
START-OF-SELECTION. IF p_host = ''. CALL METHOD cl_gui_frontend_services=>registry_set_dword_value EXPORTING root = cl_gui_frontend_services=>hkey_current_user key = 'Software\Microsoft\Windows\CurrentVersion\Internet Settings' value = 'ProxyEnable' dword_value = 0 IMPORTING rc = value EXCEPTIONS OTHERS = 4. ELSE. SHIFT p_port LEFT DELETING LEADING '0' . CONCATENATE p_host':' p_port INTO server.