Friday, May 15, 2015

How to attach RTF Layout to the Concurrent Program From Back End:


Using submit_request will only submits the program and will not attach any layout or print option.
Code below will help to set XML publisher template/layout along with print option.

NOTE: Add_layout and Add_printer procedures are optional in calling submit_request. Use only if you need to set them.

Layout is submitted to a concurrent request using below procedure

fnd_request.add_layout (
                    template_appl_name   => 'Template Application',
                    template_code        => 'Template Code',
                    template_language    => 'en', --Use language from template definition
                    template_territory   => 'US', --Use territory from template definition
                    output_format        => 'PDF' --Use output format from template definition
                     );


Setting printer while submitting concurrent program

fnd_submit.set_print_options (printer      => lc_printer_name
                                   ,style        => 'PDF Publisher'
                                   ,copies       => 1
                                   );

fnd_request.add_printer (
                    printer => printer_name,
                    copies  => 1);



DECLARE
   lc_boolean        BOOLEAN;
   ln_request_id     NUMBER;
   lc_printer_name   VARCHAR2 (100);
   lc_boolean1       BOOLEAN;
   lc_boolean2       BOOLEAN;
BEGIN

      -- Initialize Apps
      fnd_global.apps_initialize (>USER_ID<
                                 ,>RESP_ID<
                                 ,>RESP_APPL_ID<
                                 );
   -- Set printer options
   lc_boolean :=
      fnd_submit.set_print_options (printer      => lc_printer_name
                                   ,style        => 'PDF Publisher'
                                   ,copies       => 1
                                   );
   --Add printer
   lc_boolean1 :=
                fnd_request.add_printer (printer      => lc_printer_name
                                         ,copies       => 1);
  --Set Layout
  lc_boolean2 :=
               fnd_request.add_layout (
                            template_appl_name   => 'Template Application',
                            template_code        => 'Template Code',
                            template_language    => 'en', --Use language from template definition
                            template_territory   => 'US', --Use territory from template definition
                            output_format        => 'PDF' --Use output format from template definition
                                    );
   ln_request_id :=
      fnd_request.submit_request ('FND',                -- application
                                  'COCN_PGM_SHORT_NAME',-- program short name
                                  '',                   -- description
                                  '',                   -- start time
                                  FALSE,                -- sub request
                                  'Argument1',          -- argument1
                                  'Argument2',          -- argument2
                                  'N',                  -- argument3
                                  NULL,                 -- argument4
                                  NULL,                 -- argument5
                                  'Argument6',          -- argument6
                                  CHR (0)               -- represents end of arguments
                                 );
   COMMIT;

   IF ln_request_id = 0
   THEN
      dbms.output.put_line ('Concurrent request failed to submit');
   END IF;
END;

5 comments:

  1. According to Stanford Medical, It is in fact the ONLY reason this country's women get to live 10 years longer and weigh on average 19 KG less than we do.

    (And realistically, it has NOTHING to do with genetics or some secret-exercise and absolutely EVERYTHING to do with "how" they are eating.)

    P.S, I said "HOW", and not "what"...

    Tap this link to see if this little questionnaire can help you find out your real weight loss potential

    ReplyDelete
  2. ayo bergabung dengan bolavita khusus new member lgsg di berikan 10%
    dan Bonus TO 0.8 % menag kalah juga dapat ^^
    tanpa ribet dan masih banyak bonus2 lain nya
    semua di berikan tanpa ribet pelayanan terbaik 24 jam
    depo wd secepat kilat ^^ sabung ayam bangkok


    info lbh lanjut :
    WA: +628122222995

    ReplyDelete