cancel
Showing results for 
Search instead for 
Did you mean: 

Get Terminal or Client ID from the Webdynpro ABAP application

former_member186078
Active Participant
0 Kudos

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

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi

Is possible get any information about client computer? (e.g. computer name, IPaddress, MACaddres, Windows UserName... or???)

Cookie??? Session ID???

Thank you

former_member186078
Active Participant
0 Kudos

Hi Smoula 99,

        What action are your performing? Are you trying to gather that information from SAP GUI login session, if so, you can get it using TERMINAL_ID_GET function module.

thomas_jung
Developer Advocate
Developer Advocate
0 Kudos

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.

former_member186078
Active Participant
0 Kudos

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

thomas_jung
Developer Advocate
Developer Advocate
0 Kudos

>Let me elaborate a little on the requirement what we have is here,

The requirement doesn't change the technically situation of what the browser does or doesn't expose to the server and what the Web Dynpro Framework further allows to be sent back to the server.

former_member186078
Active Participant
0 Kudos

Do you mean that there is no way to get the Client Information? Is there any chance where we can get the same info if I open my applications using NWBC?

Thanks,

Adithya K

thomas_jung
Developer Advocate
Developer Advocate
0 Kudos

No. NWBC will have no impact on this limitation. WDA still runs in a web browser in-place within the NWBC.

former_member186078
Active Participant
0 Kudos

Thanks Thomas. Appreciate your help and time.

Regards,

Adithya K