on 05-26-2009 1:03 PM
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
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
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
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
User | Count |
---|---|
91 | |
10 | |
10 | |
9 | |
9 | |
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.