‎2014 Apr 22 11:18 AM
Dear Experts,
We have built a RFC function module with web service enabled, we are transferring data from RFC to portal through EAI.
Is it possible to capture IP address of the user through when he/she logs on to the portal.
We wanted to give access to the users based on specific ip addresses.
Is this can be achieved pro-grammatically through ABAP ?
Thanks and Regards,
Kartheek.
‎2014 Apr 22 11:27 AM
‎2014 Apr 22 11:31 AM
Thanks for the reply, but through this we get system IP address not the portal IP address or site IP address.
Thanks,
Kartheek.
‎2014 Apr 22 11:36 AM
you asked for:
"Is it possible to capture IP address of the user through when he/she logs on to the portal"
So via the method you get the frontend IP address of the user which is logged-in.
You want to give access to users based on the IP address of the server? I do not understand your requirement
‎2014 Apr 22 11:36 AM
Hi,
Try
call method cl_http_client=>create_by_url
exporting
url = 'Enter Desired URL'
importing
client = client
exceptions
others = 1.
Make the call
client->send( ).
Receivingthe Response Object
call method client->receive
exceptions
http_communication_failure = 1
http_invalid_state = 2
http_processing_failed = 3
others = 4.
ip_address = client->response->get_header_field( name = '~remote_addr' ).
Regards,
Madhumahesh.
‎2014 Apr 22 11:52 AM
Hi Madhumahesh,
Thanks for the reply, i have used the above given code and when tried i am getting errror
http_communication_failure , can you please let me know wat to do.
Thanks,
Kartheek.
‎2014 Apr 22 2:00 PM
Hi,
Check the url which you entered, or please post your code??
or you can try using the below FM's
TERMINAL_ID_GET
TERMINAL_IP_GET
if you know the host name then try the below FM's
RFC_HOST_TO_IP (or)
RFC_HOST_TO_IP0
Regards,
Madhumahesh.
‎2014 Apr 22 3:31 PM
Dear Madhu,
Please find the code below.
data: client type ref to if_http_client,
ip_address type string.
call method cl_http_client=>create_by_url
exporting
url = 'https://login.yahoo.com/config/login_verify2?&.src=ym&.intl=us'
ssl_id = ' '
importing
client = client
exceptions
others = 1.
client->send( ).
call method client->receive
exceptions
http_communication_failure = 1
http_invalid_state = 2
http_processing_failed = 3
others = 4.
ip_address = client->response->get_header_field( name = '~remote_addr' ).
Regards,
kartheek