on 03-14-2012 10:15 AM
Hi guys,
I've been looking for a way to capture the users' browser and os versions to store them into a table for a smoother support process. I've found a couple of solutions for WD Java, but nothing for ABAP.
So if you know anything about this, any help would be highly appreciated.
Jan
Hi,
You can use the method GET_PLATFORM of class CL_GUI_FRONTEND_SERVICES to get OS version.
As for the browser, web-dynpro only supports IE, Firefox and Safari browser.
Will update you if I find a way to get browser name in ABAP.
-Manish
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Manish Kumar wrote:
Hi,
You can use the method GET_PLATFORM of class CL_GUI_FRONTEND_SERVICES to get OS version.
As for the browser, web-dynpro only supports IE, Firefox and Safari browser.
Will update you if I find a way to get browser name in ABAP.
-Manish
This is bad advice as you can't use CL_GUI_FRONTEND_SERVICES from Web Dynpro. This class uses the SAPGUI Control Framework, which of course won't be present in Web Dynpro ABAP.
IF_WD_APPLICATION has some frontend information but mainly the remote IP Address and method GET_CLIENT_ENVIRONMENT (Portal, NWBC, etc - not Browser). More detailed information is captured by the WD Framework but not exposed up through the APIs.
Hi,
You can get the browser details from if_http_rquest`get_header_fields.
data cl type REF TO cl_http_request.
cl ?= wdr_task=>request.
CALL METHOD CL->IF_HTTP_ENTITY~GET_HEADER_FIELDS
CHANGING
FIELDS = fld.
But to get the instance of the HTTP REQUEST, you need to access the attributes of
WDR_TASK class.
But the problem is technically direct access to WDR_TASK is NOT supported. You can read this help document about usage of the programming interfaces of Web Dynpro:
http://help.sap.com/saphelp_nw70ehp1/helpdata/en/64/be5b4150b38147e10000000a1550b0/frameset.htm
So may be if you can get the instance of HTTP REQUEST from some other
RUNTME API classes then you could succeed.
Harshith,
Your reply pointed me in the right direction! The user agent can be picked up in methods EXECUTE_REQUEST and EXECUTE_REQUEST_FROM_MEMORY of class CL_HTTP_SERVER.
One of these two is always executed, so writing it to a memory id in both of them makes it available to all webdynpro applications.
It can be retrieved with the line
lv_useragent = server->request->get_header_field( 'user-agent').
Jan
Hi,
You can try with below code, no need for storing anything in memory,
DATA: lo_http_request TYPE REF TO cl_http_request.
DATA: lt_fields TYPE tihttpnvp.
lo_http_request ?= wdr_task=>request.
lo_http_request->get_header_fields(
CHANGING
fields = lt_fields " Header fields
).
Explanation - "request" attribute in Class "WDR_TASK" is a static attribute so you can directly access it without any indirect way to access, once you get the reference to CL_HTTP_REQUEST you can simply call method
get_header_field( ) or get_header_fields( ) to get all Header Data, parameter 'user-agent' contains the desired value.
I wrote the above code in WD View init() method.
Thank You.
Br.
Tushar Shinde
hello ,
Could you please explain me how can we get the windows login id in webdynpro application.
DATA: lo_http_request TYPE REF TO cl_http_request.
DATA: lt_fields TYPE tihttpnvp.
lo_http_request ?= wdr_task=>request.
lo_http_request->get_header_fields(
CHANGING
fields = lt_fields " Header fields
).
in lt_fileds, user_agent is not giving the my windows login id.
it is giving : Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; Trident/4.0; .NET CLR 1.1.4322; InfoPath.2; .NET CLR 2.0.50727; .NET4.0C; .NET4.0E)
Could you please me how can I get the windows login id in webdynpro application.
User | Count |
---|---|
86 | |
10 | |
10 | |
9 | |
7 | |
7 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.