Retrieve Portal User ID in WD ABAP Application

Hi ,
i have to make an Iview which calls WebDynABAP application and give me output that who has logged into Portal .problem is how to pick the user id from the portal ,i have logged in and how to use that in my WebDynABAP application.is there any function which import or give u that user id and i can store it and display it.
Regards
Govind

Hi Govind Turka,
have a look at this thread
[WD4A: pass portal logged in userID to WebDynpro ABAP IView.|WD4A: pass portal logged in userID to WebDynpro ABAP IView.]
or you can create a FM in ABAP and get the SY-UNAME and in the application wherever you want you can call that method and get the SY-UNAME.
Hope this helps.
Cheers-
Pramod

Similar Messages

  • Create portal user using web dynpro abap application

    Dear All,
    I would like to know is it possible to create portal user-id through web dynpro abap application.
    My requirement is
    > I have to create a web dynpro abap application. In the web dynpro abap application I have name email-id and phone number as entry fields.
    > I will click on submit, one unique id will get created. This unique id will be the login id for portal.
    I found how to create portal user using web dynpro java, but i could not find regarding web dynpro abap.
    If it is possible to create the portal users using web dynpro abap pls share the code as well.
    Regards,
    Swapnil Indulkar

    Hi swapnil,
    I think by using BAPi.. BAPI_USER_CREATE1 you can create.
    Please check this...
    Create portal user from webdynpro abap
    Creating user and assigning a group through code
    user administration su01
    How can i get the portal user id from logon ticket in the webdyn 4 ABAP
    Cheers,
    Kris.
    Edited by: kissnas on May 21, 2011 8:47 AM

  • Userid of a Portal-user in Web Dynpro ABAP

    Dear colleagues,
    we want to migrate our application from BSP to Web Dynpro ABAP and I'm looking for a procedure how I can get the userid of a Portal-user in Web Dynpro ABAP which is running inside an iView ?
    In BSP I used iView application parameter user_id and in the BSP the event handler for data retrieval with:
    userid = runtime->server->request->get_form_field( 'userid' ).
    Found a lot of entries how to do it in Java but no one for WDA ?
    Thanks in advance
    Michael

    Hi Michael,
    Actualy it is not so trivial. You have some options:
    1) In case user_id is parameter of iView you can read URL parameter like described here Webdynpro ABAP url-parameters
    2) In case user_id is not iView parameter you can use usuall ABAP <i>sy-uname</i> system variable.
    But pay attantion that it is not really EP user. Here we have 2 options: user mapping and SSO. In case of user mapping <i>sy-uname</i> will contain R/3 user which is mapped to EP user. In case of SSO <i>sy-uname</i> will contain same user name like in EP, because by using SSO user must ne the same on issuing and accepting systems.
    Best regards, Maksim Rashchynski.

  • How to access a Portal User Info from a J2EE application?

    Hi,
    I have deployed a j2ee application in portal and its running fine.
    from that application i need to assign some roles to some users.i have the user id.
    so my doubt is can i access the portal user info from this j2ee application?i have some servlets in the j2ee application....can i get the portal user info from this servlet?
    plz help me
    regards,
    Visweswar

    Hi,
    Please check out this to get the portal user information from Java -
    WdClientUser class/Interface to aciehve this.
    Please check out these links on the same -
    WDClientUser.getClientUser IUser
    help needed
    Regards
    Lekha

  • Need a call a portal iView from a WebDynPro ABAP Application

    Hi,
    I have to call a portal iView from the WD ABAP application.
    The iView root is e.g.
    folder1/folder2/check_workset1/iView
    How can we call it using Absolute navigation or Relative Navigation.
    I just want to call this path.
    Can anyone provide me with a code snippet.
    Best Regards
    Sid

    Hi ,
    I am calling the following method in my action call of a Webdynpro ABAP View
      CALL METHOD lo_portal_manager->NAVIGATE_ABSOLUTE
      EXPORTING
        NAVIGATION_TARGET   = 'Roles://portal_content/xxxx._and_remuneration'
        NAVIGATION_MODE     = IF_WD_PORTAL_INTEGRATION=>CO_SHOW_EXTERNAL
       WINDOW_FEATURES    =
       WINDOW_NAME        =
       HISTORY_MODE       =
       TARGET_TITLE       =
          CONTEXT_URL       = 'http://xxx.xxx.adsint.biz:50000/irj/portal'
       POST_PARAMETERS    = ABAP_FALSE
       USE_SAP_LAUNCHER   = ABAP_TRUE
       BUSINESS_PARAMETERS =
       LAUNCHER_PARAMETERS =
    But it is still noot opening the page for me from the WD ABAP application.
    Can anyone let me know , what can be the reason.
    Best Regards
    Sid

  • How to get Portal user from a standalone Java application

    Hi,
    I have a standalone Java application from where I need to fetch the Portal User Information like userid and email id.
    I am using the below line of code
    iUser = UMFactory.getUserFactory().getUserByLogonID("e017939");
    I have included the jar file com.sap.security.api , But it was giving me the below exception
    java.lang.NoClassDefFoundError: com/sap/tc/logging/Location
         at com.sap.security.api.UMFactory.<clinit>(UMFactory.java:55)
         at com.am.wcas.java.mailscheduler.kmaccess.FetchDataFromKM.getiUser(FetchDataFromKM.java:29)
         at com.am.ScheduleEmails.main(ScheduleEmails.java:89)
    and I am getting a pop Up message from the Java Virtual Machine Launcher, saying a Fatal Exception has occured and the Program will exit.
    Then I went throught he SDN threads and they asked me to include the
    logging.jar and com.sap.security.perm.api .
    I Included them, then also, it is giving me Exception
    java.lang.NoClassDefFoundError: com/sap/engine/lib/logging/LoggingHelper
         at com.sap.security.api.UMFactory.<clinit>(UMFactory.java:56)
         at com.am.FetchKMData.main(FetchKMData.java:30)
    Exception in thread "main"
    and I am getting a pop Up message from the Java Virtual Machine Launcher, saying a Fatal Exception has occured and the Program will exit.
    Kindly let me know if it is possible to access the User info using UMFactory in a standalone Java application. If yes kindly let me know where i am going wrong.
    Regards,
    Shilpa B.V

    Hi Shilpa,
    1. Check that you have added com.sap.security.api within the Your Project>Libraries folder (under navigation tab) and also added jars in the build path of the Your Project under project>properties>Build Path.
    2. In case you have a DC instead of Web Dynpro Project then you have to add the com.sap.security.api under Your DC>Used DCs and have compile time and runtime dependency added.
    Here java.lang.NoClassDefFoundError is caused basically due to only build time dependency added and reference to the jar missing at runtime. Rest the code to retrieve the current user id using UME API and getUserByLogOnID("....") method with/without portal environment would not be an issue at all.
    Regards,
    Tushar SInha

  • Portal user ID  read in abap webdynpro.

    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,
    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

  • Retrieve portal user

    Hi,
    can somebody help me. I want at starting of a WD application. That it retreives the portal user as in input of the bapi. Is there a tutorial or can somebody explain me what code i need to use  or ahat i need to do
    Regards

    Hi,
       Let's say that you are doing the username retrieval part in the custom controller. So create a value attribute say, UserName in the custom controller's context. Also create a value attribute of the same name in the view controller's context under the value node that is boind to the datasource property of the table and map the custom controller attribute to the view controller's attribute. The view context might look like:
    -Root
    --TableDataNode
    ---UserName
    ---... (other nodes)
       Once you have fetched the user name in the custom controller, use a code like:
    wdContext.currentContextElement().setUserName(userNameStr);
    Now in your view, create a table column to show the user name. Insert a textview as the cell editor and bind the
    text property to, TableData.UserName.
    Regards,
    Satyajit.

  • How to get Portal User Context  in Web Dynpro application

    I have successfully integrate a web dynpro app into SAP Netweaver Portal.
    Within my web dynpro app, how can I get portal user context information such as first name, last name, job title or some newly created ume attibutes.
    Is there any programmatical approach to get portal user context in my web dynpro. I not sure whether I can use the following codes in web dynpro?
    IUserContext userContext = request.getUser();
    String firstName = userContext.getFirstName();
    String lastName = userContext.getLastName();
    If yes, can someone point me the name of the jar file I have to import.
    Note : The SAP Netweaver installation that runs my web dynpro app is same with the SAP Portal.

    Hi ,
    you can use the below code to get User details and  add com.sap.security_2.0.0 > lib > com.sap.security.api.jar
    try
              IWDClientUser clientUser = WDClientUser.getCurrentUser();
    String firstName = clientUser.getFirstName();
    String lastname = clientUser.getLastName();
    catch (WDUMException e) {
                wdComponentAPI.getMessageManager().reportException("Error Retrieving User"+e.toString(),true);
    Regards,
    Sunitha Hari

  • Calling Portal iView from a WebdynPro ABAP application

    Hi ,
    I have a requirement where I need to call an iView in my portal from the Webdynpro application also existing in the portal.
    Can anyone provide me the method with source code( if possible ) to call an iView existing in the portal from the WebDynPro ABAP application.
    Best Regards
    Sid

    Hi Siddharth,
    Well, I think you can go for Portal Navigation concept.
    Please check the required source code in WDR_TEST_PORTAL_NAV Web Dynpro component. That will illustrate both Page based Navigation and Object based Navigation.
    Hope that should solve your problem.
    Regards
    <i><b>Raja Sekhar</b></i>

  • Portal integration of Webdynpro for ABAP application

    Hi all,
    Can anyone provide me with the steps for <b>integrating a Webdynpro for ABAP application with portal?</b>
    Regards,
    Bino

    Hi Bino
    Check out the following link
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/library/webas/webdynpro/portal integration of web dynpro applications.pdf
    Regards
    Rajeev.
    Do award points for helpful answers in SDN.

  • Adjusting portal theme of Web Dynpro ABAP application

    Hi,
    can the style of all UI elements in our Web Dynpro ABAP application changed in the style sheet editor of the portal?
    Or shall we avoid some already in the application?
    And can we also use the Eclipse Portal Editor to change the theme for our ABAP application in the portal?
    Thanks, Regards
    Susanne

    >
    Susanne Steib wrote:
    > Hi,
    > can the style of all UI elements in our Web Dynpro ABAP application changed in the style sheet editor of the portal?
    > Or shall we avoid some already in the application?
    >
    > And can we also use the Eclipse Portal Editor to change the theme for our ABAP application in the portal?
    > Thanks, Regards
    >
    > Susanne
    Most all UI elements can be changed by the Theme Editor.  Not all aspects of each UI element is customizable.  You will need to look through the theme editor to see what all it supports.
    You can use the Eclipse Portal Editor (unsupported by SAP) to change the them of WDA applications.

  • Routing a Portal user to a designated ABAP instance

    Hi experts,
    my concern is about performance testing in a portal landscape which is connected to several ABAP systems and a Producer Portal.
    Because functional and performance testing will temporarily overlap, we consider to route our Mercury test users to a designated ABAP/Producer Portal instance in order to separate the load from funtional testing.
    My question:
    How can I ensure that the mercury test users get linked to the second ABAP instance/Producer Portal instance?
    First ideas:
    - Does it help to assign the test users to a specific user group which could be evaluated during SSO?
    - Use of ABAP Logon groups without changing the System Object in the Portal;
    - Taking advantage of the Load Balancer configuration.
    Many thanks in advance and best regards,
    Martin

    The nice thing about loadrunner and other such products is also a headache... and that is handling the headers correctly. In the HTTP header you can set the load balance and session cookies to force the session to a particular place via a web dispatcher.
    You need also to be aware RFC's from the Portal to the ABAP and these should use a logon group that you can force to the instance you desire.
    It is also possible if going via a web dispatcher to hard code the web dispatcher to only have a single system.
    In essence there are a few ways

  • Routing a Portal User to a designated ABAP/Portal Instance

    Hi experts,
    my concern is about performance testing in a portal landscape which is connected to several ABAP systems and a Producer Portal.
    Because functional and performance testing will temporarily overlap, we consider to route our Mercury test users to a designated ABAP/Producer Portal instance in order to separate the load from funtional testing.
    My question:
    How can I ensure that the mercury test users get linked to the second ABAP instance/Producer Portal instance?
    First ideas:
    - Does it help to assign the test users to a specific user group which could be evaluated during SSO?
    - Use of ABAP Logon groups without changing the System Object in the Portal;
    - Taking advantage of the Load Balancer configuration.
    Many thanks in advance and best regards,
    Martin

    The nice thing about loadrunner and other such products is also a headache... and that is handling the headers correctly. In the HTTP header you can set the load balance and session cookies to force the session to a particular place via a web dispatcher.
    You need also to be aware RFC's from the Portal to the ABAP and these should use a logon group that you can force to the instance you desire.
    It is also possible if going via a web dispatcher to hard code the web dispatcher to only have a single system.
    In essence there are a few ways

  • Retrieving portal user name

    Hi,all
    In NW 2004 I retrieved the user name of portal user by following:
    HttpServletRequest req =((com.sap.tc.webdynpro.services.sal.adapter.core.IWebContextAdapter) WDWebContextAdapter.getWebContextAdapter ()).getHttpServletRequest();   
    wdContext.currentContextElement().setUserName(req.getRemoteUser());
    But in NW 2004S it is not working.I can not to locate IWebContextAdapter.
    How can I retrieve the portal user name here?
    Regards,
    Michael

    Hi,
    Please try following code and let me know.
    import com.sap.tc.webdynpro.services.sal.um.api.IWDClientUser;
    import com.sap.tc.webdynpro.services.sal.um.api.WDClientUser;
    try
         //get the currently logged in user
         IWDClientUser wdUser = WDClientUser.getCurrentUser();
        //get the com.sap.security.api.Iuser; It is null in case wdUser represents an anonymous user
        IUser user = wdUser.getSAPUser();
       //check whether the user is anonymous
       if (user != null)
          //access logon ID by iterating through the IUserAccount array
          IUserAccount[] acct = user.getUserAccounts();
         if(acct[0] != null)
            String strUserid = acct[0].getLogonUid();
            wdContext.currentContextElement().setId(strUserid);
            //pass the value obtained from the portal to value attribute
    catch (Exception e)
       wdComponentAPI.getMessageManager().reportException("Failed to get current user: " + e.getLocalizedMessage(), true);
    Regards,
    Vaibhav

Maybe you are looking for

  • How to edit file attachments in Mavricks Mail?

    Does anyone know how to edit file attachments in Mavricks Mail? Eudora, Foxmail and many other email programs allow you to simply click file attachment, open it, edit it, and FORWARD it to others. This is extremely difficult with Mail because it forc

  • LO Extraction approx time duration for PO Items (2lis_02_itm)

    Hi All, We are supposed to use 2lis_02_itm which is a purchase order line items data and this has to be initialized in our organization as previously there were no one using it. But, as we have to use LO extraction for PO item, we have been trying to

  • Tomahawk DataScroller - NullPointerException with navigation panel

    Hi all, I'm trying to implement navigation on a dataTable with DataScroller. Except from the dataTable content the jsp is a copy / paste from the tomahawk cars example. My jsp structure has 3 main elements - datatable - scroller one for datatable nav

  • Error in linking 9iforms with 9iDatbase

    first error i am facing is frm-10142 http listener not running on your port 8888 or check ur runtime preference i check the listener it's working ok second error i received after running the form is frm-90928 postional parameter after key on command

  • BIOS COMPATIBLE MODE -LENOVO G560

    Hello, BIOS COMPATIBLE MODE -LENOVO G560 What is that ------COMPATIBLE MODE -------IN BIOS Settings for SATA CONTROLLER MODE IS IT FOR 32 bit & 64 bit Applications & OS ?? Can I Install Windows 7(32/64)  and Microsoft Office XP on that Are there any