REPORT ZEXAMPLE.

DATA: TERM_IP LIKE ARFCTID,

IP_ADDR(20) TYPE C,

IP_BIT(3) TYPE C,

HOSTADDR(4) TYPE X,

HEX_CHAR TYPE X,

HADDR_X(8) TYPE X,

IP_LEN TYPE I,

HEXIP_LEN TYPE I VALUE 0,

HEXIP TYPE I,

CHAR_HEX TYPE I.

CALL FUNCTION 'ARFC_GET_TID'

IMPORTING

TID = TERM_IP.

HOSTADDR = TERM_IP(8).

HADDR_X = HOSTADDR.

DESCRIBE FIELD HOSTADDR LENGTH HEXIP_LEN.

HEXIP_LEN = HEXIP_LEN - 1.

DO HEXIP_LEN TIMES.

HEX_CHAR = HADDR_X+HEXIP(1).

CHAR_HEX = HEX_CHAR.

IP_BIT = CHAR_HEX.

CONDENSE IP_BIT.

IP_LEN = STRLEN( IP_ADDR ).

IP_ADDR+IP_LEN = IP_BIT.

IP_LEN = STRLEN( IP_ADDR ).

IP_ADDR+IP_LEN = '.'.

HEXIP = HEXIP + 1.

ENDDO.

HEX_CHAR = HADDR_X+HEXIP(1).

CHAR_HEX = HEX_CHAR.

IP_BIT = CHAR_HEX.

CONDENSE IP_BIT.

IP_LEN = STRLEN( IP_ADDR ).

IP_ADDR+IP_LEN = IP_BIT.

WRITE:/ 'SERVER IP ADDRESS IS:', IP_ADDR.