on 02-15-2012 4:16 PM
Hello Friends,
I am having a requirement where I need to "get the TERMINAL NAME or THE CLIENT ID of the system I logged" inside a webdynpro application. For example, I do a remote login to a different system from my laptop and execute a webdynpro application, I need to get the information of my laptop. I was able to get this information inside normal ABAP dynpro using SE37, if I use the following method:
Call method Cl_gui_frontend_services=>is_terminal_server
CALL METHOD cl_gui_frontend_services=>environment_get_variable
EXPORTING
variable = 'CLIENTNAME'
CHANGING
value = l_env_var_value
EXCEPTIONS
cntl_error = 1
error_no_gui = 2
not_supported_by_gui = 3
OTHERS = 4.
This piece works perfectly in normal programs, but not with the ABAP Webdynpro. Yes, I understand the reason behind it and even SAP Help also says the same that "cl_gui_frontend_Services" is not supported for Webdynpro.
So, I would like to know the alternative for this. I tried using the following:
Method I
Function module TH_USER_INFO
Method II
Function module TH_USER_LIST
Method III
DATA: lo_component TYPE REF TO if_wd_component,
lo_application TYPE REF TO if_wd_application,
ip TYPE string,
clenv TYPE i.
lo_component = wd_comp_controller->wd_get_api( ).
lo_application = lo_component->get_application( ).
ip = lo_application->get_remote_address( ).
clenv = lo_application->get_client_environment( ).
Method IV
data: client type ref to if_http_client,
ip_address type string.
****Create the Call
call method cl_http_client=>create_by_url
exporting
url = 'http://www.yahoo.com'
ssl_id = ' '
importing
client = client
exceptions
others = 1.
****Make the call
client->send( ).
****Receive the 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' ).
All of them returns the IP address of the remote system I logged in, but not my laptop terminal information.
Appreciate if you guys can help.
Thanks,
Adithya K
Hi
Is possible get any information about client computer? (e.g. computer name, IPaddress, MACaddres, Windows UserName... or???)
Cookie??? Session ID???
Thank you
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You need to keep in mind that you are in a web browser and the browser is designed to protect the client machine from access by the server. Therefore there is a very limited information about the client available. The IP address is about all your going to be able to get via the Web Dynpro framework.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Thomas,
Thanks for your quick reply. The problem is even though i get the IP address, it is showing the IP related to the server I logged in, but not the Client from which I logged. So, Am I missing any part because of which I just see the Server information but not Client.
Secondly, as you know we can have Dynamic IP Addresses, so if I login to the application from one Terminal, then my IP addresses would be frequently changing everytime. In that case, it would be good if I can know that TERMINAL or CLIENT name from which I logged in, right.
Let me elaborate a little on the requirement what we have is here, we are using Thin clients. All the thin clients login to One server and perform their transactions by using the webdynpro application. So, our goal is to display the information based on the Termina(in the sense the Thin client)l from which they logged in.
I think this might help you to get an idea of what we have and whether we have a workaround for it.
Appreciate your time.
Thanks,
Adithya K
User | Count |
---|---|
83 | |
24 | |
12 | |
9 | |
7 | |
6 | |
5 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.