cancel
Showing results for 
Search instead for 
Did you mean: 

portal user ID read in abap webdynpro.

Former Member
0 Kudos

Hi All,

We have developed on web dynpro application for Dealer Portal. The Dealer logs into the portal with his ID. How can we capture this Portal User ID of the Dealer in our application.

The Portal User ID and the R/3 User ID are different.

I have followed the given steps...

Step 1

Within the Main Window of your ABAP Web Dynpro application, select Inbound Plugs tab. Now double click on the Startup Plug Named 'DEFAULT' (or what ever you have called it if you have changed this since window was created).

Step 2

Within the plug method HANDLEDEFAULT Add a new importing parameter below 'WDEVENT' parameter call it IV_USER of Type UNAME.

Step 3

Now within the code section of the plug method HANDLEDEFAULT you can freely assign the value of IV_User to an attribute of your component controller. i.e. wd_comp_controller->userid = IV_USER. Alternatively you could assign it to a wdp context node / attribute.

Please note this value will not be available with the WDDOINIT of your main view as WDDOINIT method of this view is called before the window HANDLEDEFAULT method. Put your code into the method WDDOMODIFYVIEW of your main view instead.

Step 4

Double click on the webdynpro Application, within the Parameters tab add a new parameter. You should just be able to use the F4 help on the param column and select the IV_USER entry.

Step 5

Save your application nad activate your web dynpro

With the 'Content Administration' tab of your portal

Step 1

Create an iview of type ABAP Web dynpro specifying the application name as that of your created wdp (must be exactly the same).

Key information for creating iView:

Create as iView template (select template as SAP Web Dynpro iView)

namespace = sap (check service name in SICF if this is not correct)

Application Name = ZWDA_EXAMPLE(name of your wdp created in se80)

Application Parameters = IV_USER=

Step 2

Save and setup any other details required when creating any other iView

but not able toget user id .

Rakesh

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi,

As your portal and R/3 users are different, check the SSO logon.

You can still get the parameters in the WDDOINIT of the view by using the code -

lv_uanme = wdr_task=>client_window->get_parameter( IV_USER ).

Have you included the window as the component usage in the respective controllers.

Regards,

Lekha.

Former Member
0 Kudos

Hi,

Thanks for reply but still i am not able to get IV_uname in view doinit() method its giving error as IV_USER is not defined.

Can you explain how to include window as component usage in the respective controllers.

Rakesh

Former Member
0 Kudos

Hi Kumar,

i m not clear about your doubt. do you want to know about component usage?/

for component usage go thru this thread

thnks

Former Member
0 Kudos

Hi,

My question is :-

We have developed on web dynpro application for Dealer Portal. The Dealer logs into the portal with his ID. How can we capture this Portal User ID of the Dealer in our application.

The Portal User ID and the R/3 User ID are different.

Rakesh

Former Member
0 Kudos

Hi,

Try out this code:

data client_info_object type ref to if_wdr_client_info_object.

data lv_user type string.

client_info_object = wdr_task=>client_window->client_info_object.

lv_user = client_info_object->get_parameter( if_http_form_fields_sap=>sap_user).

lv_user will give the user name.

Thanks,

Rahul

Former Member
0 Kudos

HI Rahul,

I have tried your code but its not giving any value. Can you suggest me for this require any configuration.

Rakesh

Former Member
0 Kudos

Hi,

Why don't you use the sy-uname to get the login details of user.

Portal users are mapped to R/3 system, so using sy-uname will definitely give the user details.

  • Function module to get employee details by passsing user name

CALL FUNCTION 'HR_GET_EMPLOYEES_FROM_USER'

EXPORTING

user = sy-uname

iv_with_authority = space

TABLES

ee_tab = lt_ee_tab.

IF lt_ee_tab[] IS NOT INITIAL.

  • Passing employee number to export parameter

READ TABLE lt_ee_tab INTO ls_ee_tab WITH KEY user = sy-uname.

IF sy-subrc = 0.

ev_pernr = ls_ee_tab-pernr.

ELSE.

ev_failed = gc_failed.

ENDIF.

ELSE.

ev_failed = gc_failed.

ENDIF.

Does this help?

Thanks,

Rahul

Former Member
0 Kudos

Hi,

User id is not same of portal and r/3. Its diffrent. I want to read portal login id and get it into webdynpro abap.

Rakesh

Former Member
0 Kudos

Hi,

I wonder if portal userid is not mapped to R/3 userid then how user will be able to access the application.

Application will ask for user name and password on each click of the application. So i don't understand use case here because until user enter the R/3 identification he/she can not access the application(code).

I checked the Interface IF_WD_PORTAL_INTEGRATION but didn't find anything which returns user name. Although there are attributes which can return the version of portal and other information.

Thanks,

Rahul

former_member199125
Active Contributor
0 Kudos

Hiii,

where we need to implent this code?

Thanks in advance

Regards

Srinivas

Former Member
0 Kudos

Hi,

Before to process further you need to know releavent user right? in WDDOINIT method write your code to get user id.

After getting user id you further process in any other actions.

Cheers,

Kris.

former_member199125
Active Contributor
0 Kudos

If i have 6 applications in ESS, do i have to write the code in wddoinit method in all 6 applications in order to get particular personal number in all 6 apps?