Getting userid by code

HI
Can anyone tell me what is the code to get the userid of the user loged in currently.
I m using the following code . But getting some error in this .
IUser user = UMFactory.getUserFactory().getUser("j2ee_admin");
user.getFirstName());
user.getLastName());
Is it the correct one ?
Thanks
shashank

HI
Thanks for ur quick response.
But I think for this I need to create portal component.
But my problem is that, I have created a custom login module .Inside that i have created a simple java class and deploy it as .sda file in the sdm .
Here is the code:
package Test;
import java.io.File;
import java.io.FileWriter;
import java.util.Date;
import java.util.Map;
import javax.security.auth.Subject;
import javax.security.auth.callback.CallbackHandler;
import javax.security.auth.login.LoginException;
import com.sap.engine.interfaces.security.auth.AbstractLoginModule;
import com.sap.security.api.IUserAccount;
public class pwdExpiryNotification  extends AbstractLoginModule {
public void initialize(Subject arg, CallbackHandler handler, Map map1, Map map2){
          IUserAccount useraccount;
public boolean login() throws LoginException {
          try {
IUser user = UMFactory.getUserFactory().getUser("j2ee_admin");
user.getFirstName());
user.getLastName());
}catch (Exception e) {
e.printStackTrace();
return false;
     /* (non-Javadoc)
@see com.sap.engine.interfaces.security.auth.AbstractLoginModule#commit()
     public boolean commit() throws LoginException {
          // TODO Auto-generated method stub
          return false;
     /* (non-Javadoc)
@see com.sap.engine.interfaces.security.auth.AbstractLoginModule#abort()
     public boolean abort() throws LoginException {
          return false;
     /* (non-Javadoc)
@see com.sap.engine.interfaces.security.auth.AbstractLoginModule#logout()
     public boolean logout() throws LoginException {
          return false;
Can u pls see the code and tell me how could i get the details abt the current login code.
Thanks
shashank
Yours answer must appreciate !

Similar Messages

  • How can i get the source code from java concurrent program in R12

    Hi 2 all,
    How can i get the source code from java concurrent program in R12? like , "AP Turnover Report" is java concurrent program, i need to get its source code to know its logic. how can i get its source code not the XML template?
    Regards,
    Zulqarnain

    user570667 wrote:
    Hi 2 all,
    How can i get the source code from java concurrent program in R12? like , "AP Turnover Report" is java concurrent program, i need to get its source code to know its logic. how can i get its source code not the XML template?
    Regards,
    ZulqarnainDid you see old threads for similar topic/discussion? -- https://forums.oracle.com/forums/search.jspa?threadID=&q=Java+AND+Concurrent+AND+Source+AND+Code&objID=c3&dateRange=all&userID=&numResults=15&rankBy=10001
    Thanks,
    Hussein

  • How to get USERID system parameter in the report

    I can pass the user id, password and connect string through the USERID parameter, but how do I get it in the report? (I need to pass the USERID to a different report, I got a error when I use :USERID). Thanks.
    WJ

    There are two steps I used with which to get USERID into the report.
    1) Create a user parameter, P_USER, datatype CHARACTER, width 20
    2) in Report Trigger AFTER PARAMETER FORM (could also be BEFORE REPORT), insert the following line of code:
    :P_USER := USER;
    Now you can create an F_USER variable with P_USER as its source and place it in the report as you would with any other user parameter.
    Regards,
    Steve

  • How can I get the connection code for the magic track pad?

    I want to use my magic trackpad and I scrapped the box with the connection code. How can I get it again? I don't need it for Mac, but yes for windows...

    user570667 wrote:
    Hi 2 all,
    How can i get the source code from java concurrent program in R12? like , "AP Turnover Report" is java concurrent program, i need to get its source code to know its logic. how can i get its source code not the XML template?
    Regards,
    ZulqarnainDid you see old threads for similar topic/discussion? -- https://forums.oracle.com/forums/search.jspa?threadID=&q=Java+AND+Concurrent+AND+Source+AND+Code&objID=c3&dateRange=all&userID=&numResults=15&rankBy=10001
    Thanks,
    Hussein

  • How can i get the tax code from Condition record number

    Hi all,
    i have the Condition record number from which i have to get the tax code as i looked inthe KNOP that Condition record number there but no tax code is maintained there.
    so is there any other way to find the tax code for particular Condition record number
    Regards
    suresh

    hi suresh,
    can u tell me the field name for condition record number and in which table it is stored.
    because i knew one condition number which is stored in table EKKO and the field name is
    KNUMV- Number of the document condition.
    from ekko take relevant details and look for  ekpo where u find the tax code
    filed name of the tax code id MWSKZ- Tax on sales/purchases code

  • I get this error code when trying to update from an older version of Firefox: The operation can't be completed because you don't have permission to access some of the items.

    While trying to upgrade from a previous version of Firefox, I get this error code: "The operation can’t be completed because you don’t have permission to access some of the items."
    == installing ==
    == User Agent ==
    Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_6_3; en-us) AppleWebKit/531.22.7 (KHTML, like Gecko) Version/4.0.5 Safari/531.22.7

    I resolved the problem in Snow Leopard by logging out of my (admin) account and logging into my daughter's account on the same machine. She doesn't have admin privileges, so when I tried to install Firefox 4 in her account, I had to authenticate with my admin identity and PW. Installation went smoothly after that. My guess is that you could also simply create a new account on the same machine and install Firefox 4 from that. I have no idea why this works.

  • I purchased and downloaded Adobe Photoshop Elements 13 from Amazon and when I try to open it, it's asking for a "Redemption Code".  Where do I get the that code?

    When I try to open the Adobe software, it asks from the Redemption Code when on an Adobe web site.  The instructions that came in the download say that this is a 24 digit code of numbers and letters.  The only thing I got from Amazon was an Order Key, which is also 24 digits, but only numbers and the software didn't like that code…  I walked through the steps on the Adobe web site to get my redemption code, but the final step before giving me my redemption code is to enter my redemption code…  I have to enter the code for them to give me the code…???  Am I missing something???  Do I get this "Redemption Code" from Amazon, or from Adobe?

    You would get the redemption code, or perhaps even the serial number, from whomever you purchased the software from, apparently Amazon, so talk to them.  This wouldn’t be the first time they’ve sold something that didn’t have all the numbers needed to license it.
    A redemption code is something that is usually on the inner disc packaging if you purchase the media in a box, and there is a barcode on the outside of the packaging that must be scanned at the checkout register to activate the hidden inner code so you can redeem it at home on that website.  This is what happens if you buy PSE from a brick-and-mortar store like Best Buy.  I don’t’ know what happens if you purchase the downloaded version as I have never done that.
    A redemption code is 24-digits of letters and numbers that you enter into a website to get a serial number, once and only once.  The serial number of only 24-digits, no letters, is what you enter into the software during the install or when you run it and it asks if you want to register or run in a trial mode—whatever the exact phrasing is.
    In any case it sounds like you don’t have either a redemption code or serial number—although perhaps something is listed on the purchase confirmation or your account online at Amazon or even in an e-mail from Amazon.

  • Can someone help me with getting ccbill's codes to work with a flash based website?

    I have built a pay per view site entirely in flash. I set up the account with ccbill and they gave me the codes for the gallery buttons. The problem is the codes are 1. html and 2. there not url's. The picture galleries are in the same folder on the server as my html and swf files. Is there actionscript to get the ccbill codes to work? Here is one of the codes ccbill sent:  <A HREF="http://www.lexiefyfe.com/ccbill9001/index.htm"><img src="ccbutton.jpg"></A>
    Thanks for any consideration or help with this matter.
    wstcstkd

    Hi Civilclerk1,
    In order to achieve your requirement, we can try to use the following expression to instead the last_name column and first_name field:
    last_name: =iif(Fields! staff_role.Value="Lead Atty" or Fields! staff_role.Value="BK Mgr" or Fields! staff_role.Value="Partner" ,Fields! last_name.Value,nothing)
    first_name: =iif(Fields! staff_role.Value="Lead Atty" or Fields! staff_role.Value="BK Mgr" or Fields! staff_role.Value="Partner" ,Fields! first_name.Value,nothing)
    Besides, if we don’t want see the blank row in the tablix, we can add a filter as below in the tablix:
    Expression:=iif(Fields! staff_role.Value="Lead Atty" or Fields! staff_role.Value="BK Mgr" or Fields! staff_role.Value="Partner" ,1,0)
    Operator:=
    Value:=1
    If there are any misunderstanding, please elaborate the issue for further investigation.
    Thanks,
    Katherine Xiong
    Katherine Xiong
    TechNet Community Support

  • My iPhone 5 will not sync i keep getting an error code (-50)?

    hi,
    my iPhone 5 will not sync i keep getting an error code (-50) all iOS and Itunes are up to date.
    this ***** cause i just spent $$$ on itunes and i want to sync my phone!!
    Cheers

    Read here:
    http://support.apple.com/kb/TS1583

  • How to get the Response Code when a URL is launched from Web Dynpro

    Hello Experts,
    I have a Web Dynpro Application in which in one of its views i have an IFrame UI element in which i will show a resource stored somewhere ..
    But before showing it i want to check if the resource actually exists. For this i have to check the HTTP Response code from Web Dynpro Application without setting it in the Iframe..
    I am using the following code to get the Response Code:
    try{
    URL url = new URL("Some Url");
    HttpURLConnection.setFollowRedirects(false);
    HttpURLConnection connection = (HttpURLConnection) url.openConnection();
    connection.connect();
    wdComponentAPI.getMessageManager().reportSuccess("Response code ="+connection.getResponseCode());
    }catch(Exception e){
    wdComponentAPI.getMessageManager().reportSuccess("Exception");
    Now the Problem is whatever response Code occurs 403 (for No Proper Authorization), 404 (for Resource not found) etc..
    i always get Response Code=  500 (which is for Internal Server Error) shown in the messgae i have printed.
    Please let me know the correct way of getting the Response Code from Web Dynpro.
    Also my resource is lying on a SAP Portal 6.4
    Best Regards
    Sundeep
    Edited by: Sundeep Sethi on Feb 18, 2008 9:07 AM
    Edited by: Sundeep Sethi on Feb 18, 2008 10:23 AM

    Hi,
      Check this code from /thread/5242768 [original link is broken] if it works.
    try{
    URL myurl = new URL("http://calendar.google.com");
    URLConnection connection = myurl.openConnection();
    if(connection instanceof HttpURLConnection) {
    HttpURLConnection httpConnection = (HttpURLConnection) connection;
    HttpURLConnection.setFollowRedirects(true);
    httpConnection.setRequestMethod("HEAD");
    httpConnection.connect();
    System.out.println("Response = "+httpConnection.getResponseCode());
    catch(Exception e) {
    // print exception
    Regards,
    Harini S

  • How to set up a pdf embeded with different code so that people can get different excess code after they paid on-line?

    For example, I want to set up a pdf embeded with code, and send it on-line. People who want it should pay for it first and get the access code. I need to set different access code in order to avoid people A give the access to people B.

    Unless you use a very expensive DRM protection measure, I don't see how it's possible. How can you prevent someone from sending a file with the password to someone else?

  • When I try to get the key code for office it tells me its already been used.  My mac had a new hard drive in its first year, could it be because of this?  How can I get the office I've paid for but never used?

    My mac had to have a new hard drive in its first year.  Now, when I try to get the key code for office it tells me its already been used.  How do i get the office I've paid for but never used?

    The product key is sent to you by email as part of the purchase confirmation.
    If you have lost it, log into your Microsoft account.

  • How can I use a SCH-LC11 device in CHINA which bought from ebay. I am not Verizon customer but I prefer to using your 4G LTE Router . How can I get the unlock code? The device may have a bad ESN but I only use it in CHINA. Kindly looking forward your repl

    How can I use a SCH-LC11 device in CHINA which bought from ebay. I am not Verizon customer but I prefer to using your 4G LTE Router . How can I get the unlock code? The device may have a bad ESN but I only use it in CHINA. Kindly looking forward your reply. Thanks!

    It's good to read Antoniad's post.  It reassures me that I can use my new iPad as an international communication device which is the reason I purchased the thing.  However, I called Verizon today (my provider of cellular data) who told me that I can't just pop in a SIM card as you suggested.  He also said that he was from the "Pre-Pay" division of Verizon and he was certain that I couldn't do what I planned to do.  I was extremely disappointed as I had called Apple prior to buying the iPad and I read the algorhythm on the website for choosing an iPad before purchasing.  Those sources were quite specific and the information seemed clear.  I would be able to use my iPad to communicate through cellular connections while traveling on the road, literally, abroad.  I was told that I could pop in a data card wherever I was, just as you indicated in your message above, and voila I was good to go.  The Verizon rep definitively rained on that parade, but said that I might be able to do this if I have a "Post-Pay" account, a different area of Verizon.  I haven't had the chance to talk to this division yet, so I looked to Apple's Support for answers.  Maybe I will find out that I can use my iPad as an international communication device while traveling on the road afterall, however, it appears I may need a different type of account (Post-Pay), something I was never warned about. Can I switch to this kind of account?  I don't know.  I have to find out.  If you have any information about this issue, it would be good to share since I strongly suspect there are others who bought the iPad for the same purpose that I have.

  • Function Module to get ABAP source code for a specific version

    Hi all
    Is there a function module that I can use to get the source code of another function module at a specific version?
    For example, can I call a function module passing in "FM_NAME" and "FM_VERSION" and have it return the lines of code associated with that object?
    Thanks in advance.
    Stuart

    Thanks guys
    That's incredibly helpful! I have one more question that I just thought of last night...
    Is there a way to hook into the code activation process? I want to be able to take a snapshot of the ABAP source code at each point when it is activated for use in another system, but need to be able to intercept this event and get the source code at that point in time.
    Any ideas?
    Thanks!

  • I get an error code when burning a movie to DVD

    I use Premiere Elements 10 in my iMac OS lion vers. 10.7.2
    I have 250 Gb free on my hard disc. The movie I try to burn is between 3-4 Gb
    When starting to burn my movie to a DVD the following is seen in order on the screen:
    Encoding Menu 2 of 2
    Computing Media
    Burning disks 1 of 1
    and then it burns (at the end pretty quickly) to 99% and stay there.
    I get an error code:
    Internal software error: /Users/labuser/premiere/elements/molecules/pre10-bullseye/molecule-17/External/AuthorScri pt/Source/DVDCreator/FormatLib/Ma.....
    When I look on the DVD, it looks like nothing has been burnt to the DVD.
    What can be wrong?
    gardie10

    I still have trouble with burning my movies to DVD.
    Have tried the following:
    Found that I had "-" in many of my file names (clips). I removed them from the file names, but this had no effect.
    I moved my entire project folder to a shorter path folder. This had no effect.
    I have not managed to find blank DVDs on sale here in Gothenburg, but will try to buy them online.
    I have four movies that I want to burn on DVD discs.
    Have succeeded in burning two of them.
    I've tried to find what distinguishes between the two that are OK and the two that I have not succeeded with. They are all at about the same size, about 27-29 minutes long.
    The clips are .m2ts and .mts files.
    In one of the movies that are OK, all the clips are .m2ts files. In the second movie (that is OK), most of the clips are .m2ts files, but also there are .mts files.
    In the other two movies that are not OK, it's a mix of .m2ts and .mts files.
    When I try to burn the two movies which failed, I get the same course as I showed earlier (with an error code).
    I must admit that I was wrong when I previously wrote that I could burn all the movies to my hard drive. The ones I can not burn to DVD, I can not burn to my hard drive.
    gardie10

Maybe you are looking for

  • Macbook Pro Grey Screen

    Hello, My Macbook Pro has suddenly started to show the grey screen upon startup. It only seems to happen when both my USB ports have connections made. When I disconnect the USB connections startup goes smoothly, Do I need to just boot up my Macbook P

  • Completing an album from multiple sources

    A couple of times I have purchased a single track from an album with iTunes and then ended up buying the full album on CD - either because I bought the disc at a live gig or bought the album on discount from a store. When I do this, I find it difficu

  • Oracle reports Server Freezing

    Hi I'm sorry if this has been posted before but I have been looking for about 45 minutes and couldn't find exactl what I was looking for. I have three different reports servers(11.1.1.2.0) which all display the same symptoms if they are unused over t

  • SureType

    Hi,Sorry – I am quite new with the product – but this feature is critical for me. If I have 8310 – does it support SureType?  If not, which 3rd application I can use for it.Regards,Ofer

  • We are unable to process your request.

    Please, I received the email with the confirmation of the apple but when I open the link the following message appears: "we are unable to process your request."   What can I do?