获取终端信息
1.获取计算机名:
1 DATA pcname TYPE string. 2 CALL METHOD cl_gui_frontend_services=>get_computer_name 3 CHANGING 4 computer_name = pcname. 5 CALL METHOD cl_gui_cfw=>update_view. 6 TRANSLATE pcname TO LOWER CASE .
2.获取终端IP地址:
1 DATA lv_name TYPE char40. 2 DATA lv_ip TYPE char20. 3 DATA v_terminal TYPE xuterminal. 4 CALL FUNCTION 'TERMINAL_ID_GET' 5 EXPORTING 6 username = sy-uname 7 IMPORTING 8 terminal = v_terminal 9 EXCEPTIONS 10 multiple_terminal_id = 1 11 no_terminal_found = 2 12 OTHERS = 3. 13 14 IF v_terminal IS NOT INITIAL . 15 SPLIT v_terminal AT '-' INTO lv_ip lv_name . 16 TRANSLATE lv_name TO LOWER CASE . 17 ENDIF .
待续……