3 Replies Latest reply on Dec 17, 2006 11:50 PM by 306078

    fnd_global.apps_initialize does not work

    239397
      Hi have found that fnd_global.apps_initialize does not work in SQL developer. If you run it in Toad it work fine. The purpowse of fnd_global.apps_initialize is to allow you to run code as if it was been run in Apps 11i.

      Any idea why?


      BEGIN
           fnd_global.apps_initialize (888,888,888);
      END;
        • 1. Re: fnd_global.apps_initialize does not work
          306078
          I have been able to use fnd_global.apps_initialize in both SQL Developer 1.0 and 1.1.

          When you say that it does not work, what do you mean?
          • 2. Re: fnd_global.apps_initialize does not work
            239397
            I have a piece of code that fires off a pile of concurrent requests. Under SQL developer the request id is always zero (i.e. a request is not created) but under Toad it is fine. Some one else in my Company has a similar issue. Any ideas?

            DECLARE
            p_requestid NUMBER;
            i NUMBER;
            BEGIN
            fnd_global.apps_initialize (111,111,111); -- prod

            FOR i IN 10670 .. 10675 LOOP
            p_requestid :=
            fnd_request.submit_request
            (application => 'INV',
            -- application short name
            program => 'INV_ITEM_CAT_ASSIGN_OI',
            -- program short name
            argument1 => i,
                      argument2 => 1,
                      argument3 => 1);
            COMMIT;
            --dbms_output.put_line('Req ' || p_requestid);
            END LOOP;
            END;
            • 3. Re: fnd_global.apps_initialize does not work
              306078
              I use the following and I can successfully submit a concurrent request:

              declare
              l_req_id number;
              begin
              fnd_global.apps_initialize(1234, 20419, 0);
              l_req_id := fnd_request.submit_request(application => 'FND',
              program => 'FNDCPPGD',
              argument1 => 'FND',
              argument2 => 'FNDCPPGD');
              COMMIT;
              end;
              /

              This submits the "Concurrent Program Details Report" concurrent program within the "Application Developer" responsibility as user ID 1234 - reporting on itself, just for the sake of passing something in the parameters.

              Suggestions:

              I would put some debugs after the apps initialize to make sure that the values are set properly (ie fnd_global.user_id, resp_id, resp_appl_id). I assume that the IDs are right as it works in TOAD, but worth a check.

              Do you get a result from FND_RESPONSIBILITY_VL for the responsibility id? I have had some issues with userenv('LANG') not being set correctly (ie returns GB, but only have US translations for Apps), and I don't know whether that would affect submitting requests.

              Apart from that, no other suggestions leap to mind.