Checking user existance , how?

Hi,
How can I check existance of a user in a sap client?
Thanks

Hi,
Try this link
[http://sap.ittoolbox.com/groups/technical-functional/sap-basis/all-users-list-254303]
Regards,
Surinder

Similar Messages

  • Checking user exist on resource or not before creating it

    Hi Friend,
    I have requirement in which I need to check user id exist in resource or not before creating it.
    I can not testUser as it checks user in LH not in resource. I need to see if my user is existing in particular resource.
    Can some one throw some light on it?
    Thx

    Hi Mark,
    I am creating user from resource A to resource B during active sync, but when I am creating user in recource B , i will generate unique ID and will check if any other user with same ID is existing or not.
    Thx

  • Checks users Exists in user group or not?

    Hi All,
    bool userExsists = SPContext.Current.Web.CurrentUser.Groups.Cast<SPGroup>().Any(g => g.Name.ToLower() == "groupname".ToLower());
    Is there ay alternative for findings that user is in group or not? Is it best way to achieve this?

    Hi,
    To check if a user exists in user group, please use the code below:
    string userName = "contoso\\admin";//your user account
    string groupName = "SP Members";// your user group
    using (SPSite spSite = new SPSite("http://sp")) // your site collection URL
    using (SPWeb spWeb = spSite.OpenWeb())
    SPUser user = spWeb.EnsureUser(userName);
    if (user.Groups.Cast<SPGroup>().Any(g => g.Name.Equals(groupName)))
    Console.WriteLine("User " + userName + " is a member of group " + groupName);
    else
    Console.WriteLine("User " + userName + " is NOT a member of group " + groupName);
    Or you can use PowerShell command below:
    $w = get-spweb http://my
    $gs = $w.SiteGroups
    $g = $gs[12]
    $user = $g.Users.GetByEmail("[email protected]")
    if($user -eq $null){write-host "User Not Found"}
    Best regards.
    Thanks
    Victoria Xia
    TechNet Community Support

  • How to check whether portal user exists or not using UM API.

    Hi Experts,
    Let us say i need to create an user account "PortalUser",i know how to create an user,setting first name,lastname,password for that.
    but here before creating the portal user, i need to check whether that user exists or not.If user already exists ,then i  need to skip the below for creating the user.
    IUserFactory userFact = UMFactory.getUserFactory();
    IGroupFactory groupFact = UMFactory.getGroupFactory();
    IRoleFactory roleFact = UMFactory.getRoleFactory();
    IUser tuser = userFact.getUserByLogonID("PortalUser");
    IUserMaint newUser = userFact.newUser("PortalUser");
    newUser.setFirstName("PortalUser");
    newUser.setLastName("Test");
    newUser.setEmail("PortalUser.Testatgmaildotcom");
    //Locale PortalLanguage = new Locale(Lang.toLowerCase(), "");
    Locale PortalLang=new Locale("en");
    newUser.setLocale(PortalLang);
    newUser.save();
    newUser.commit();
    IUserAccount userAcc = UMFactory.getUserAccountFactory().newUserAccount("PortalUser", newUser.getUniqueID());
    userAcc.setPassword("test1test$");
    userAcc.save();
    userAcc.commit();     
    Thanks in advance.
    Thanks
    Sony.

    Hi,
    Try this code,
    IUserFactory factory = UMFactory.getUserFactory();
    IUser user = factory.getUserByLogonID(userId);
    lastName = user.getLastName();
    firstName = user.getFirstName();
    refer this pdf,its very helpful
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/library/events/webinars-nw-rig/using%20the%20user%20management%20api%20with%20ep%20applications%20-%20webinar%20powerpoint.pdf
    Regards,
    Sunaina Reddy T

  • How to capture the User input value to user exist function module.

    Hi,
    How can i capture user input value.Here i am using User exist in BPS variable.
    Calculating days using user exist functin module and my input is another variable i.e user defined value.
    How can i capture user defined vaule into my function module.
    This is very urgent can you help me..
    Thanks....

    Hi!
    You can get the instance using the method get_instance of the class cl_sem_variable, and call the method get_value with the return. Check the example:
          CALL METHOD cl_sem_variable=>get_instance
            EXPORTING
              i_area       = (planning area)
              i_variable   = (variable name)
            RECEIVING
              rr_variable  = lr_var
            EXCEPTIONS
              not_existing = 1
              OTHERS       = 2.
          CHECK sy-subrc IS INITIAL.
          CALL METHOD lr_var->get_value
            RECEIVING
              rto_value = et_value
            EXCEPTIONS
              error     = 1.
    After this, read the first line of the table et_value (it should be the value that the user choose on the screen).
    seeya!
    Robson

  • How can I add the extra fields to a datasource usign "User Exist"?

    Hallo guys,
    I have a quesiton on an extractor.
    I want to extend fields for an extractor, and the additional fields come from a third table (for the extractor, there is a view which 2 Tabels inner join.) The third table should have LEFT OUTER JOIN relation to the other 2 tables. So I have to use "User Exist" to add the fields from the third table to my data source.
    How  can I do it via user exist?
    Thanks for any hint in advance.
    Regards,
    Liying

    Hi LiYing,
    You can do this using a USER EXIT.
    if you edit the ABAP program ZXRSAU01, you can add ABAP coding:
    here an example for 1_CO_PA....:
    <i>   CASE i_datasource.
           WHEN '1_CO_PA_.......
    Data assignments
          LOOP AT c_t_data INTO wa_s_copa.
            IF ( NOT wa_s_copa-vrgar = 'F' ) OR ( wa_s_copa-curtype = 'B0' ).
            wa_s_copa-zzratio = 1.
            wa_s_copa-zztr_rate = 1.
            wa_s_copa-zzcurkey_tc = wa_s_copa-rec_waers.
    Company Code Currency Invoice *
          ELSEIF wa_s_copa-curtype = '10'.
    assume one exchange rate per invoice
            SELECT SINGLE * FROM ce19991 INTO wa_ce1
               WHERE belnr = wa_s_copa-belnr
               AND   paledger = '02'
               AND   vrgar    = wa_s_copa-vrgar
               AND   versi    = space
               AND   perio    = wa_s_copa-perio.
            MOVE wa_ce1-kursf TO lx_kursf.
            MOVE wa_ce1-frwae TO wa_s_copa-zzcurkey_tc.
            IF NOT wa_ce1-frwae EQ 'EUR'.
    read rate ( table is buffered ).
              CLEAR: wa_tfact, wa_ffact.
              lx-datlo = 99999999 - sy-datlo.
              SELECT single tfact ffact FROM tcurf into
              (wa_tfact, wa_ffact)
              WHERE kurst EQ 'M'
              AND fcurr EQ wa_ce1-frwae
              AND tcurr EQ 'EUR'
              AND gdatu LE lx-datlo.
              IF sy-subrc NE 0.
                SELECT single tfact ffact FROM tcurf into
                (wa_tfact, wa_ffact)
                WHERE kurst EQ 'EURX'
                AND fcurr EQ wa_ce1-frwae
                AND tcurr EQ 'EUR'
                AND gdatu LE lx-datlo.
              ENDIF.
              IF wa_tfact = 1.
                wa_s_copa-zzratio = wa_ffact.
              ELSE.
                IF wa_tfact NE 0.
                  wa_s_copa-zzratio = 1 / wa_tfact.
                ENDIF.
              ENDIF.
            ELSE.
    eur : eur => always 1
              wa_s_copa-zzratio = 1.
            ENDIF.
            IF lx_kursf < 0.
              wa_s_copa-zztr_rate = lx_kursf * -1 .
            ELSE.
              CHECK lx_kursf > 0.
              wa_s_copa-zztr_rate = 1 / lx_kursf.
            ENDIF.
          ENDIF.
      ENDLOOP.
    ENDCASE.
    </i>

  • How to view all the users existing in a Client

    Hi
    Can any one help me, How to view all the users existing in a Client (Other than SM04 and AL08).
    I want to view not only the active users, but all existing users.
    Thanks in Advance
    Chandra

    Hi,
    Check table devaccess. to get all developers list
    Reward points if helpful.
    Regards,
    Mukul
    Edited by: Mukul Sharma on Jun 2, 2008 12:10 PM

  • How to findout Which are the User Exist had been activated for T.Code

    Hi Everybody,
    -->I want to know, what are the user exits have been activated or used for a particular t.code.
    --> I will give a small example it will be give clear idea on my question.
    -->For my client, they used lot of user exist and screen exist in the sales order screen,how to find out them. Is their any easy way to find out which are user exist had been acitviated for a particular template.
    Regards,
    Madhan

    If you mean how to see a user list with the T-Code they are using.
    Then you can just use T-Code SM04.
    It will give all the information about those user.
    Or If you mean User Exists.
    then please use this link
    http://www.sap-img.com/abap/a-short-tutorial-on-user-exits.htm
    Thanks,
    Sugauli
    Edited by: Sugauli on Dec 11, 2008 9:20 PM

  • Checking to see whether a user exists in a Windows Active Directory

    I have a little java applet that has to run through a large list of users, and for one of its tasks, it has to check to see whether that user exists. Mostly this is the same as running with local users, with the one exception that I can't just check to see if a home directory exists.
    Right now I am checking the return code from "net user <username>", but executing this program for every potential user is extremely slow.
    Are any java facilities to deal with users on the local system? If not, does anyone else have any suggestions?
    Also, a note for any responses- I'm using java to get around the lack of any easy way to set up a good scripting environment on Windows. I have a completed tool, and I don't want to rewrite it.

    <sarcasm>
    I seem to remember this service - what's it called? Ah, Google. Yes.
    </sarcasm>
    Try http://www.google.com/search?q=java+active+directory+query

  • How to solve the issue "CUV check user equivalence failed" ?

    Folks,
    Hello. I am installing Oracle 11gR2 RAC using 2 VMs (rac1 and rac2) whose OS are Oracle Linux 5.6 in VMPlayer according to the website http://appsdbaworkshop.blogspot.com/2011/10/11gr2-rac-on-linux-56-using-vmware.html
    In order to install Grid Infrastructure, we need to run Cluster Utility Verification (CUV) at first by running the cammand below:
    [ora11g@rac1 grid]$ ./runcluvfy.sh stage -pre crsinst -n rac1,rac2 -verbose
    Its output:
    Performing pre-checks for cluster services setup
    Check: User equivalence for user “ora11g”
    Node Comment
    rac1 failed
    rac2 failed
    Result: PRVF-4007 : User equivalence check failed for user “ora11g”
    ERROR:
    User equivalence unavailable on all the specified nodes
    Verification cannot proceed
    Pre-check for cluster services setup was unsuccessful on all the nodes.
    As you see above, check user equivalence failed. I have run the 4 commands to fix this error as below:
    [ora11g@rac1 /]$ ssh-keygen
    Its output:
    Generating public/private rsa key pair.
    Enter file in which to save the key (/home/grid/.ssh/id_rsa):
    Enter passphrase (empty for no passphrase):
    Enter same passphrase again:
    Your identification has been saved in /home/grid/.ssh/id_rsa.
    Your public key has been saved in /home/grid/.ssh/id_rsa.pub.
    The key fingerprint is:
    0c:10:6c:3b:ae:21:63:64:f8:0d:0e:d8:f0:41:32:ff [email protected]
    [ora11g@rac1 .ssh]$ cat *pub >>authorized_keys
    [ora11g@rac1 .ssh]$ ssh rac1
    Its output:
    The authenticity of host ‘rac1 (127.0.0.1)’ can’t be established.
    RSA key fingerprint is 9d:ae:51:7c:72:81:07:37:31:92:f1:c8:90:bc:52:55.
    Are you sure you want to continue connecting (yes/no)? yes
    Warning: Permanently added ‘rac1′ (RSA) to the list of known hosts.
    Write failed: Broken pipe.
    [ora11g@rac1 .ssh]$ ssh rac1-priv
    Its output:
    The authenticity of host ‘rac1-priv (192.168.137.35)’ can’t be established.
    RSA key fingerprint is 9d:ae:51:7c:72:81:07:37:31:92:f1:c8:90:bc:52:55.
    Are you sure you want to continue connecting (yes/no)? yes
    Warning: Permanently added ‘rac1-priv,192.168.137.35′ (RSA) to the list of known hosts.
    Write failed: Broken pipe.
    After run the 4 commands above, I run the command below again:
    [ora11g@rac1 grid]$ ./runcluvfy.sh stage -pre crsinst -n rac1,rac2 -verbose
    Its output is the same:
    PRVF-4007 : User equivalence check failed for user “ora11g”
    ERROR:
    User equivalence unavailable on all the specified nodes
    Verification cannot proceed
    I think the problem is "Broken pipe" and ssh cannot write authorized_keys to the machines.
    My question is:
    Do any folk understand how to solve the issue CUV "check user equivalence failed" for 2 VMs ?
    Thanks.

    Folks,
    Hello. Thanks a lot for replying.
    I have installed Grid Infrastructure a few times. Each time, on step 7 of 9, the installer fixes and checks 2 machines correctly. The entire installation has 3 parts as below:
    1) Install Grid Infrastructure for a Cluster
    2) Execute Root Scripts for Install Grid Infrastructure for a Cluster (script is root.sh)
    3) Configure Oracle Grid Infrastructure for a Cluster that includes NCA, ASMCA, PICA and CVU.
    Each time, on step 8 of 9, the Installer installs Grid Infrastructure for a Cluster successfully that includes "Prepare, Copy files, Link binaries, Setup files and Perform remote operations".
    But when the Installer get to part 3 CVU, it fails and then the Database cannot be installed.
    Deinstall Grid is a very complicated process to do. Because of this reason, we need to run CVU at first to make sure everything is correct for 2 machines before install Grid.
    Even we ignore "user equivalence (ssh)", we don't know whether other items can be passed or not because CVU cannot proceed to check the machines.
    My question is:
    How to have the script "runcluvfy.sh" continue to check the machines while confronting "user equivalence failed" ?

  • How to use Pl/sql block to edit check user input

    Hi,
    Please advise on PL/SQL Block code that could be used to Check User input from within a Loop and proceed conditionally based upon User Supplied compliant Input. Thanks in advance.

    Hi,
    yakub21 wrote:
    You could use the ACCEPT to get user input and then assign the input to a variable that could then be verified.
    I believe that anything is possible because we don't yet have proof that it is not!
    I do have code that can accept user input. Is it PL/SQL code? Sybrand was clearly talking about PL/SQL:
    sybrand_b wrote:
    Pl/sql is for server side code, it is not a front end tool, and it is incapable of the functionality you describe.If you do have PL/SQL code that accepts user input, please post an example. A lot of people, including me, would be very interested.
    Pass the user-input value to a variable and then assign that value to another variable from within a Declare of a PL/SQL Block.
    The opportunity here is to figure a way to loop with user input until desired input is entered by the user before proceeding with the code. I'm using PL/SQL Block because I don't want the code to persist. I just want to run it as part of database configuration procedure. ThanksIt sounds like you're talking about SQL*Plus, which is a very poor tool for looping or branching.
    It's possible, but it's not pretty. The following thread shows one way of looping in SQL*Plus:
    Re: How to give the different values to runtime parameters in a loop?

  • How to check user profile service working in sharepoint 2013?

    HI All,
    How to check user profile service working or not in sharepoint 2013? Thanks.

    Hi,
    Select which OU's you want to synchronize, then check if all users in those OU's have a user profile in the user profile service application.
    Nico Martens - MCTS, MCITP
    SharePoint 2010 Infrastructure Consultant / Trainer

  • How to check file exist in applet?

    I would like to check the existance of a file from an applet. How can I achieve that? I'd tried many attempts but still fail to get an answer. Please kindly help.
    Below are my file structures:-
    folder/applet/myApplet.java
    folder/appletView.jsp
    folder/image/image1.gif
    I would like to check if image1.gif exist. if yes, then load and display it in applet, but I having problem on the how to specify the file location.

    Assuming image1 is in the same folder as the applet:
              InputStream is;
              byte[] buf = new byte[1024];
              URLConnection urlc = null;
              try {
                   URL a = new URL(this.getCodeBase(),"image1.gif");
                   urlc = a.openConnection();
                   is = urlc.getInputStream();
                   int len = 0;
                   ByteArrayOutputStream bos = new ByteArrayOutputStream();
                   while ((len = is.read(buf)) > 0) {
                        bos.write(buf, 0, len);
                   // close the inputstream
                   is.close();
              } catch (IOException e) {
                   try {
    // image1.gif probably does not exist
                        // now failing to read the inputstream does not mean the server did not send
                        // any data, here is how you can read that data, this is needed for the same
                        // reason mentioned above.
                        ((HttpURLConnection) urlc).getResponseCode();
                        InputStream es = ((HttpURLConnection) urlc).getErrorStream();
                        int ret = 0;
                        // read the response body
                        while ((ret = es.read(buf)) > 0) {
                        // close the errorstream
                        es.close();
                   } catch (IOException ex) {
                        // deal with the exception
              }

  • HOW TO WRITE USER EXIST IN B/W

    HI SAP GURUS,
    CAN U PLZ TEL ME THE STEP BY STEP " HOW CAN I WRITE USER EXIST"
    AND I WHICH SUATION I CAN USE THIS OPTION
    AND SAME WITH CUSTOMER EXIST ALSO
    WITH AN EXAMPLE OF ANY ENHANCEMENT
    PLZ KINDLY HELP ME

    Hi,
    here customer exit we can write in r/ and bw side
    in both places also tcode is CMOD
    first create the project
    assign the enhancement for that procjet and go the compnents
    it shows the screns as below.
    if it is r/3
    exit_saplrsap_001--for transaction data
    exit_saplrsap_002---for master data attribute
    exit_saplrsap_003---master text
    exit_saplrsap_004 -heiraraches
    situation in r/3
    if do u want to enhance(add the field) to already existed data source or appling some condition on that.
    if it is bw
    same as r/3 for creating the project and assign the enhancement then click on copmonets it shows the fm  as exit_saplrrso_001
    in bw for all the things it is the FM
    doble click on that it takes to the main code screen with zxrsuo1 structure and go for change mode and write the code.
    in bw situation
    when ever u want calculate something internaly in dyanaamically u can write the code
    for example if u r created varible on some date colum now u want dynamically current date
    then u can write code as below
    when 'ur varibale name'
    clear l_s_range.
    l_s_range-low = sy-datum(current date)
    l_s_range-option = 'eq'.
    l_s_range-sign = 'i'.
    append l_s_range to e_t_range.
    here we r getting the current date for that varible
    like that in different scenarios we can use this.
    Thanks & Regards,
    Sathish

  • How to check users session

    hi,
    I need to check user session like how much cpu a particular user consuming, user's session time and what activity he is doing(i.e. how many sql statement worked on and currently working).

    The below query will give you details on :
    SID/Serial, Foreground, Shadow, OS User, Ora User, User Module, Status Flags, Tran Active, Login Time, Last Call, Lock/Latch, Latch Spin, Current SQL stmt, Previous SQL stmt, Session Waits, WAITED Locks.
    set serveroutput on size 50000
    set echo off feed off veri off
    accept 1 prompt 'Enter Unix process id: '
    DECLARE
      v_sid number;
      s sys.v_$session%ROWTYPE;
      p sys.v_$process%ROWTYPE;
    BEGIN
      begin
        select sid into v_sid
        from   sys.v_$process p, sys.v_$session s
        where  p.addr     = s.paddr
          and  (p.spid    = &&1
           or   s.process = '&&1');
      exception
        when no_data_found then
          dbms_output.put_line('Unable to find process id &&1!!!');
          return;
        when others then
          dbms_output.put_line(sqlerrm);
          return;
      end;
      select * into s from sys.v_$session where sid  = v_sid;
      select * into p from sys.v_$process where addr = s.paddr;
      dbms_output.put_line('=====================================================================');
      dbms_output.put_line('SID/Serial  : '|| s.sid||','||s.serial#);
      dbms_output.put_line('Foreground  : '|| 'PID: '||s.process||' - '||s.program);
      dbms_output.put_line('Shadow      : '|| 'PID: '||p.spid||' - '||p.program);
      dbms_output.put_line('Terminal    : '|| s.terminal || '/ ' || p.terminal);
      dbms_output.put_line('OS User     : '|| s.osuser||' on '||s.machine);
      dbms_output.put_line('Ora User    : '|| s.username);
      dbms_output.put_line('User Module : '|| s.module);
      dbms_output.put_line('Status Flags: '|| s.status||' '||s.server||' '||s.type);
      dbms_output.put_line('Tran Active : '|| nvl(s.taddr, 'NONE'));
      dbms_output.put_line('Login Time  : '|| to_char(s.logon_time, 'Dy HH24:MI:SS'));
      dbms_output.put_line('Last Call   : '|| to_char(sysdate-(s.last_call_et/60/60/24), 'Dy HH24:MI:SS') || ' - ' || to_char(s.last_call_et/60, '990.0') || ' min');
      dbms_output.put_line('Lock/ Latch : '|| nvl(s.lockwait, 'NONE')||'/ '||nvl(p.latchwait, 'NONE'));
      dbms_output.put_line('Latch Spin  : '|| nvl(p.latchspin, 'NONE'));
      dbms_output.put_line('Current SQL statement:');
      for c1 in ( select * from sys.v_$sqltext
                  where HASH_VALUE = s.sql_hash_value order by piece) loop
        dbms_output.put_line(chr(9)||c1.sql_text);
      end loop;
      dbms_output.put_line('Previous SQL statement:');
      for c1 in ( select * from sys.v_$sqltext
                  where HASH_VALUE = s.prev_hash_value order by piece) loop
        dbms_output.put_line(chr(9)||c1.sql_text);
      end loop;
      dbms_output.put_line('Session Waits:');
      for c1 in ( select * from sys.v_$session_wait where sid = s.sid) loop
        dbms_output.put_line(chr(9)||c1.state||': '||c1.event);
      end loop;
    --  dbms_output.put_line('Connect Info:');
    --  for c1 in ( select * from sys.v_$session_connect_info where sid = s.sid) loop
    --    dbms_output.put_line(chr(9)||': '||c1.network_service_banner);
    --  end loop;
      dbms_output.put_line('Locks:');
      for c1 in ( select /*+ ordered */
              decode(l.type,
              -- Long locks
                          'TM', 'DML/DATA ENQ',   'TX', 'TRANSAC ENQ',
                          'UL', 'PLS USR LOCK',
              -- Short locks
                          'BL', 'BUF HASH TBL',  'CF', 'CONTROL FILE',
                          'CI', 'CROSS INST F',  'DF', 'DATA FILE   ',
                          'CU', 'CURSOR BIND ',
                          'DL', 'DIRECT LOAD ',  'DM', 'MOUNT/STRTUP',
                          'DR', 'RECO LOCK   ',  'DX', 'DISTRIB TRAN',
                          'FS', 'FILE SET    ',  'IN', 'INSTANCE NUM',
                          'FI', 'SGA OPN FILE',
                          'IR', 'INSTCE RECVR',  'IS', 'GET STATE   ',
                          'IV', 'LIBCACHE INV',  'KK', 'LOG SW KICK ',
                          'LS', 'LOG SWITCH  ',
                          'MM', 'MOUNT DEF   ',  'MR', 'MEDIA RECVRY',
                          'PF', 'PWFILE ENQ  ',  'PR', 'PROCESS STRT',
                          'RT', 'REDO THREAD ',  'SC', 'SCN ENQ     ',
                          'RW', 'ROW WAIT    ',
                          'SM', 'SMON LOCK   ',  'SN', 'SEQNO INSTCE',
                          'SQ', 'SEQNO ENQ   ',  'ST', 'SPACE TRANSC',
                          'SV', 'SEQNO VALUE ',  'TA', 'GENERIC ENQ ',
                          'TD', 'DLL ENQ     ',  'TE', 'EXTEND SEG  ',
                          'TS', 'TEMP SEGMENT',  'TT', 'TEMP TABLE  ',
                          'UN', 'USER NAME   ',  'WL', 'WRITE REDO  ',
                          'TYPE='||l.type) type,
           decode(l.lmode, 0, 'NONE', 1, 'NULL', 2, 'RS', 3, 'RX',
                           4, 'S',    5, 'RSX',  6, 'X',
                           to_char(l.lmode) ) lmode,
           decode(l.request, 0, 'NONE', 1, 'NULL', 2, 'RS', 3, 'RX',
                             4, 'S', 5, 'RSX', 6, 'X',
                             to_char(l.request) ) lrequest,
           decode(l.type, 'MR', o.name,
                          'TD', o.name,
                          'TM', o.name,
                          'RW', 'FILE#='||substr(l.id1,1,3)||
                                ' BLOCK#='||substr(l.id1,4,5)||' ROW='||l.id2,
                          'TX', 'RS+SLOT#'||l.id1||' WRP#'||l.id2,
                          'WL', 'REDO LOG FILE#='||l.id1,
                          'RT', 'THREAD='||l.id1,
                          'TS', decode(l.id2, 0, 'ENQUEUE', 'NEW BLOCK ALLOCATION'),
                          'ID1='||l.id1||' ID2='||l.id2) objname
           from  sys.v_$lock l, sys.obj$ o
           where sid   = s.sid
             and l.id1 = o.obj#(+) ) loop
        dbms_output.put_line(chr(9)||c1.type||' H: '||c1.lmode||' R: '||c1.lrequest||' - '||c1.objname);
      end loop;
      dbms_output.put_line('=====================================================================');
    END;
    undef 1
    set feedback on;
    set veri on;

Maybe you are looking for