3 Replies Latest reply: Nov 9, 2012 10:38 AM by Hussein Sawwan-Oracle RSS

    How to capture the user name who is running concurrent program

    Sabyasachi
      Hi Everyone

      In oracle apps when i want to store the user name who is running a concurrent program in specific responsibility.

      For that I created a table as USER_INFO which has a column called USERNAME.

      T o capture the user name i created a before report trigger and wrote the following code which will store the username into USER_INFO
      function insert_trg return boolean is
      begin
        insert into USER_INFO(USERNAME) values
       (select fnd_profile.value('USERNAME') from dual);
       COMMIT;
        return (TRUE);
      end;
      In the above code i used fnd_profile.value('USERNAME') to store the username but after running the concurrent program when i am query the table it returns no rows .

      It means the fnd_profile.value('USERNAME') is not storing the value.

      Please tell me what to do?

      Regards
      Sabyasachi
        • 1. Re: How to capture the user name who is running concurrent program
          597001
          In order to fetch any FND_PROFILE or FND_GLOBAL values you need to initialize apps
          fnd_global.apps_initialize(user, resp_id,resp_application_id)
          
          begin 
          fnd_global.apps_initialize(0,20420,1); 
          dbms_output.PUT_LINE (FND_PROFILE.VALUE('ORG_ID')); 
          dbms_output.PUT_LINE (FND_PROFILE.VALUE('USER_ID')); 
          dbms_output.PUT_LINE (FND_PROFILE.VALUE('USERNAME')); 
          end;
          Check the following MOS note
          How To Set the Applications Context (FND_GLOBAL.APPS_INITIALIZE) [ID 209185.1]
          Cheers,
          ND
          Use the "helpful" or "correct" buttons to award points to replies / Mark the thread as answered, if your question is answered.
          • 2. Re: How to capture the user name who is running concurrent program
            Srini Chavali-Oracle
            Information about concurrent requests that have been run is already stored in table FND_CONCURRENT_REQUESTS - information includes the user id and responsibility used to launch the concurrent request

            http://etrm.oracle.com/pls/et1211d9/etrm_pnav.show_object?c_name=FND_CONCURRENT_REQUESTS&c_owner=APPLSYS&c_type=TABLE

            HTH
            Srini
            • 3. Re: How to capture the user name who is running concurrent program
              Hussein Sawwan-Oracle
              For that I created a table as USER_INFO which has a column called USERNAME.
              Why do you have to create a new table/column if you can find the same information from FND_CONCURRENT_REQUESTS and FND_USER tables?

              You can check the value of REQUESTED_BY column in FND_CONCURRENT_REQUESTS table and link it with USER_ID column in FND_USER and get the USER_NAME from the FND_USER table.

              Thanks,
              Hussein