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

Function module to find terminal IP address

Former Member
0 Likes
2,876

Hi,

Can anyone tell me what is the function module to get IP address of the machine from which I am logging into SAP server.

I can see that IP address in SM04 for my terminal but is there functional module which can fetch this terminal details in an ABAP report?

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,806

hi,

terminal_id_get

Hi,

Can anyone tell me what is the function module to get IP address of the machine from which I am logging into SAP server.

I can see that IP address in SM04 for my terminal but is there functional module which can fetch this terminal details in an ABAP report?

4 REPLIES 4
Read only

Former Member
0 Likes
1,807

hi,

terminal_id_get

Read only

Former Member
0 Likes
1,806

hi,

try this

DATA terminal LIKE usr41-terminal.

CALL FUNCTION 'TERMINAL_ID_GET'

  • EXPORTING

  • username = sy-unamegf

IMPORTING

terminal = terminal.

WRITE:/ 'Terminal:',terminal.

reward if usefull...

Read only

0 Likes
1,806

Thanks Dhawani and Smith.

Query resolved and points rewarded.

Read only

Former Member
0 Likes
1,806

hi,

this is the code which gives the ip address

DATA ip_addr TYPE c LENGTH 50.

CALL METHOD cl_gui_frontend_services=>GET_IP_ADDRESS

RECEIVING

ip_address = ip_addr

EXCEPTIONS

cntl_error = 1

error_no_gui = 2

not_supported_by_gui = 3

OTHERS = 4.

if sy-subrc <> 0.

write:/'address not received'.

else.

write:/'ip adress = ',ip_addr.

endif.

reward points if useful.