1. Function
DATA : TERMINAL LIKE USR41-TERMINAL, TERMNM TYPE CHAR20, "Terminal name DATA : L_ADDRESS TYPE CHAR15. CALL FUNCTION 'TERMINAL_ID_GET' EXPORTING USERNAME = SY-UNAME IMPORTING TERMINAL = TERMINAL EXCEPTIONS MULTIPLE_TERMINAL_ID = 1 NO_TERMINAL_FOUND = 2 OTHERS = 3. SPLIT TERMINAL AT '-' INTO L_ADDRESS TERMNM.2. CLASS
DATA : L_ADDRESS type char15. CALL METHOD CL_GUI_FRONTEND_SERVICES=>GET_IP_ADDRESS receiving IP_ADDRESS = L_ADDRESS EXCEPTIONS CNTL_ERROR = 1 NOT_SUPPORTED_BY_GUI = 2 ERROR_NO_GUI = 3 OTHERS = 4.