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

Similar Messages

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

  • Retrieve authenticated user name from environment

    Hi All,
    I'm connecting to Oracle from C++ using OCCI API. At the same time, the database authentication is based on secure Oracle Wallet feature.
    conn = env->createConnection("","",connection_string);
    Now, after I've created connection can I retrieve user name from the environment or connection object without querying database?
    Thank you.

    Hi Patrick,
    I'm just trying your code example in Eclipse but it gives me plenty of errors so I guess I'm not importing the right libraries or so.
    My goal was to write just a simple response.write of the userID stored in the cookie...
    The first error appears in the "ticket.setCertificates(this.certificates);" line, saying that "certificates cannot be resolved"..
    Here's what I used :
    import com.sapportals.portal.prt.component.*;
    import com.sap.security.*;
    public class cookie extends AbstractPortalComponent
        public void doContent(IPortalComponentRequest request, IPortalComponentResponse response)
              try
              com.sap.security.core.ticket.imp.Ticket ticket = new com.sap.security.core.ticket.imp.Ticket();
              ticket.setCertificates(this.certificates);
              ticket.setTicket(base64Value);
              String vali = ticket.toString();
              ticket.verify();
              if (ticket.isValid())
              info = new SAPTicketInfo(ticket.getUser(),ticket.getSystemID(),ticket.getSystemClient(),ticket.getExpirationDate(),ticket.getCodepage());
              response.write (info);
              else
              throw new TicketVerifierException("Ticket is invalid ");
              catch (Exception ex)
              throw new TicketVerifierException("Error in verifying ticket "+ex.getMessage(),ex);
    What am I missing ?

  • Portal Users name for auditing

    Hi,
    How can i get the name of portal users. Some one told me that there is some Portal_api through which i can get Portal user and then i can write custom code to insert that name for auditing purpose in tha database table. Can any one tell me what that Portal_api is? If any has done this before then can you expalin it with some example.
    Your help in this matter will be highly appreciated.

    muhammad
    I can't tell you the exact name of any particular api but I can tell you where a good place to look.
    If you are familiar with any of the MONITOR functions on the Oracle main page, there is one sub category for "chart by user". The contents for these are located under the navigator -> contents -> monitor -> chart by user.
    I haven't drilled down far enough to find any specific calls, but since documentation seems so lacking for these thints, I have to go find an example to take apart for the pieces I need.
    Hope this helps.
    Mike

  • Extract Portal User Name From HTTP POST Request (WSRP SOAP)

    How can we extract the user name from the HTTP POST Request (*WSRP SOAP*) from the Portal to the Portlet Provider (Producer)?
    We are load balancing between the Portal (10.1.14.2) and the providers (OC4J 10.1.3.3) and would like to extract the user name within the load balancer so we can create session affinity based on it.
    BTW, we already tried using TCP Flow but were unable to see the user name.

    From the documentation, it seems that you need to use
    HttpURLConnection.setRequestMethod("POST"); // "GET" is the defaultalthough I have seen examples on the web without it.
    Try!
    Edit: Also the single quotes around userid and password may be a problem.
    Use the previous poster suggestion, but do not include the single quotes.
    Edited by: baftos on Aug 6, 2008 4:27 PM

  • Accessing the Enterprise Portal user name

    Hi All
    I want to access the name of the user who has currently logged into the portal.  And this username, I wanted to display in my .NET PDK portal application.
    Please suggest a solution to this.
    -Vijay

    Hi vijay,
    I have develpoed poratal application in Java.
    Here we have got specific interfaces like IUSER,UMFACTORY in the PDK.
    we import usermanagement.jar for using this .
    These interfaces have got defined methods to get the current logged in info from the UME.like getDisplayName(),getUserId();getEmail() etc
    I guess in .net PDK u will  have same kinda API defined.
    got ny clue from dis then points are welcomed:-)
    thanks,
    Swathi

  • How to retrieve form user name?

    Hi !
    If I catch from v$session module name (i.e. CEXCABMR form) how to get the name to ask user what is he/she doing on that form....
    You know "CEXCABMR" is not a good name for them....
    THX

    THX that was in the same time as my solution:
    set linesize 220;
    set pagesize 1600;
    set head on;
    col form_name for a15;
    col user_form_name for a36;
    col language for a3;
    col app_us for a25;
    col app_hr for a25;
    col creation_date for a20;
    col last_update_date for a19;
    accept form_name char prompt 'Input SHORT form name (Enter for all): ';
    break on form_name on user_form_name
    SELECT DISTINCT
      form_name,
      ftl.user_form_name,
      (select application_name from apps.fnd_application_tl tl where tl.application_id=atl.application_id and language='US') app_us,
      (select application_name from apps.fnd_application_tl tl where tl.application_id=atl.application_id and language='HR') app_hr,
      to_char(ftl.creation_date,'dd.mm.yyyy hh24:mi:ss') creation_date,
      to_char(ftl.last_update_date,'dd.mm.yyyy hh24:mi:ss') last_update_date
    FROM
      apps.fnd_form frm,
      apps.fnd_form_tl ftl,
      apps.fnd_application_tl atl
    WHERE
          frm.form_name like '&form_name%'
      and frm.form_id = ftl.form_id
      AND ftl.application_id = atl.application_id
    ORDER BY 1,3,2
    ;

  • 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

  • User name in Email Settings

    Dear Sir/Madam,
    Just got blackberry 8300 and activated blackberry service today with du in UAE. I did not create any user name or password in email settings. However, whenever I enter Email settings screen, it states 'Existing Users' and prompts me to enter username and password.
    How can I retrieve my user name or even do a reset on the device? Please provide complete guidance so that I can resolve the matter.
    Thanking you. 

    You bought the device used or remanufactured and the previous use never removed the PIN of that device from his or her account.
    The seller will need to call his or her carrier and ask that the PIN be removed-- you can call, but they don't have to do it for you, so be nice in asking. Just simply explain that you bought the device used and need the PIN to be used on your account now.
    1. If any post helps you please click the below the post(s) that helped you.
    2. Please resolve your thread by marking the post "Solution?" which solved it for you!
    3. Install free BlackBerry Protect today for backups of contacts and data.
    4. Guide to Unlocking your BlackBerry & Unlock Codes
    Join our BBM Channels (Beta)
    BlackBerry Support Forums Channel
    PIN: C0001B7B4   Display/Scan Bar Code
    Knowledge Base Updates
    PIN: C0005A9AA   Display/Scan Bar Code

  • USER NAMES LIST BASED IN A QUERY

    Hi
    I want to create a user names list base in a result of a query.
    I must give access to specific users which are in table, this table is for accesing to the oracle portal.
    But for defining what users must have access I need another table which contains a field defines what users can access to the application.
    How do I must do for creating this user list?
    The apex application begins when I click in its link created in the Oracle portal, this action sends a parameter of the user name of the portal.
    Based in the username sent, the first page in the apex application must execute a query on load and its result must redirect to the page for user valids or another page for invalid users.
    For that I have thought in doing an application without authentication scheme.
    Also the application must save the username for knowing what user did the last change in a table. But this username must be the same of the oracle portal user name.
    Is posible create a username list in apex which be contains the same user names of the oracle portal? How to do that?
    I expect your prompt reply.
    Any help would be thank.
    Regards.

    I think VPD (Virtual Private Database) and RLS (Row Level Security) are the tools to solve your problem. Take a look at them, there are cool demos on OTN too.
    Andy

  • How to show the First and Last name of the user instead of user name

    Gurus,
    We have the full email id of the user as the portal user name. Right now we are using the "Item Attributes - Current User" to show the user name. We don't want to show this anymore. We would like to show the First and Last name of the user on the Portal page. How can i do this. Please post a reply if you have some idea about it.
    Thanks
    Raj
    ---------

    I believe this is possible using the security APIs. See http://portalstudio.oracle.com/pls/ops/docs/FOLDER/COMMUNITY/PDK/PLSQL/DOC/PLDOC_9026/INDEX.HTML and look for person_info (Returns user information, given a user name)
    under wwsec_api
    Suggest posting any follow-up questions to the Security forum - http://forums.oracle.com/forums/forum.jsp?forum=6

  • How to fetch Portal Users data ? (Including Mapping details)

    Hi all,
    I want to retrieve Portal users data with the detail of its mapping (i.e. if the user is mapped or not with backend user? and if yes, to which backend user?).
    Thanks,
    Tejas

    Thanks for the reply Nadav.
    But what I want is the complete list of all the users, the reason being there are more than 2000 users on Portal and going for this one by one mapping checking is not really feasible time and effort wise.
    So is there any way how can I get the users data from UME or LDAP? as I have both kinds of users.
    Please guide.
    Thanks and Regards.
    Tejas

  • Tables to link Business Partner number and User Name

    Hello SAP Experts,
    I'm having a hard time looking for the relationship tables that could link the Business Partner numbers with the user name of a user. I have tried to link the BUT* tables, the USR21 table, and several HRP* tables and I can't seem to find a link. For the table BUT000, the field XUBNAME which is suppose to contain the user names of the users are left blank for some reason.
    I just want to ask if there is any other table relationships I can check so I can retrieve the User name of a user using his/her BP number or vice versa. Thank you in advance!
    Regards,
    Romeo

    hi,
    i am not sure about tables but you can use FM BP_CENTRALPERSON_GET to get the user name from BP and vice versa. Get the BP guid from BUT000 table and give that to the FM
    thanks,
    sankar.

  • Forgot password and user name... Deleted all other accounts....restarted and when prompted to sign in it requires both user and password to be filled in. Sadly I can't remember eithe

    How do I retrieve both user name and password?

    The details of the procedure depend on which version of Mac OS X you have. This video however, covers most of the recent versiona. Good luck:
    https://www.youtube.com/watch?v=CJ6AZMk2cy0

  • How to get User Name?

    Hi Guys,
    I want to retrieve the user names? Can you please tell me in which table SAP stores it?
    My SQL query will be as shown:
    SELECT SINGLE * FROM (TABLE NAME ???) INTO WORK AREA WHERE DBTAB-USERID EQ SYST-UNAME.
    Here I want the database table name where we store the user ID names.
    Thanks,
    Hemal

    Hi TCS Team,
    Please find attached code for your requirement.
    You can also get this from VIEW USSR_ADDR ( Given in one of the reply )
    CLEAR w_usr21.
    SELECT SINGLE *
    FROM usr21
    INTO w_usr21
    WHERE bname = sy-uname.
    CLEAR w_adcp.
    SELECT SINGLE *
    FROM adcp
    INTO w_adcp
    WHERE addrnumber = w_usr21-addrnumber
    AND   persnumber = w_usr21-persnumber.
    CLEAR w_name.
    SELECT SINGLE NAME_TEXT
    FROM adrp
    INTO w_name
    WHERE persnumber = w_usr21-persnumber.
    Thanks,
    Hemal Shah

Maybe you are looking for

  • Quicklook (column view) crashing finder when viewing photos

    My Finder is freezing when I am viewing photos in the column view.  It works fine in list, cover flow, and thumbnail.  Any ideas as to why the column view quicklook might be causing it to freeze?

  • Ssh tunneling

    Hi, I have tried the following: on PC1 (win xp) I have created ssh connection with port forwarding (local 8888 to remote 8888) to server1. From server1 I have created another ssh connection with portforwarding to server2(local 8888 to remote 1521). W

  • Virus protection for MacBook Pro

    Forum, When I was using FCE there where many posts about using virus protection applications,such as Norton causing problems with video editing. My MBC does not have a virus protection application but there seems to be an increasing threat to Apple c

  • At the foot of the page (CSS)

    I have a CSS footer which seems to work in IE but not FF (that is in IE it is always displayed at the bottom of the page). It needs to be within the "container" div which seems to be causing the problems as I had it working outside of the container d

  • Account Assignment Category K in KOB2

    Hello, A purchase order with account assignment category K (Cost center) appears in the commitment line items for orders list (KOB2) while there is no relation between the shown internal order and the purchase order/requisition. Regards, Jan