cancel
Showing results for 
Search instead for 
Did you mean: 

Windows login user id is not coming in webdynpro application

Former Member
0 Kudos

Hello,

I would like to fetch the  windows login id . into my webdynpro application.

I tried with the code : CL_GUI_FRONTEND_SERVICES.   but it is working only in ECC. it is not working in webdynpro abap.

I tried with the code "

  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
    ).

I checked user_agent field in lt_fileds,  in this case also it is not coming.

Could you please explain the possibility way to fetch the user id .

Accepted Solutions (0)

Answers (1)

Answers (1)

former_member184578
Active Contributor
0 Kudos

Hi,

We cannot use *GUI* functions/classes in Web Dynpro ABAP as they are GUI specific. As of now we cannot get Windows user name in Web Dynpro ABAP.

One work around is, Use javascript in BSP to get the windows user name and call Web Dynpro URL from BSP and pass the user name via url parameters

OR,

Create a Report and get the Windows user name using CL_GUI_FRONTEND_SERVICES and Call the Web Dynpro Application from your report and pass the user name via url parameters/ store user name in Shared Memory/ Temp DB and get it in the Web Dynpro Application.

Hope this helps u.,

Regards,

Kiran

Former Member
0 Kudos

hello Kiran,

Thank you for your reply.

could you please help me about the BSP application code , and linking to webdynpro  steps wise. I don't know BSP.

Thank you very much.

former_member184578
Active Contributor
0 Kudos

Hi,

You can try the other option which is creating a report and call Web Dynpro Application from Report.

In your Report you can use GUI classes to get the windows user name then call Web Dynpro Application and pass the user name.

For BSP, please check in BSP space http://scn.sap.com/community/abap/bsp

For Reference Script: http://www.pctools.com/guides/scripting/detail/108/?act=reference

This is the reference Thread in BSP: http://scn.sap.com/thread/7842

Regards,

Kiran