Submitting Request set from backend

Submitting Request set from backend, www.askhareesh.com

CREATE OR REPLACE PROCEDURE XX_SUBMIT_REQUEST_SET (P_errbuf    OUT VARCHAR2,
                                                   P_retcode   OUT NUMBER)
AS
   V_REQUEST_SET_EXIST   BOOLEAN := FALSE;
   req_id                INTEGER := 0;
   l_CONC_PROG_SUBMIT    BOOLEAN := FALSE;
   srs_failed            EXCEPTION;
   submitprog_failed     EXCEPTION;
   submitset_failed      EXCEPTION;
   l_start_date          VARCHAR2 (250);
BEGIN
   fnd_file.put_line (fnd_file.LOG, 'Calling set_request_set');
   V_REQUEST_SET_EXIST :=
      FND_SUBMIT.set_request_set (application   => ‘XXAP’,
                                  request_set   => ‘FNDRSSUB1786’);

   IF (NOT V_REQUEST_SET_EXIST)
   THEN
      RAISE srs_failed;
   END IF;

   fnd_file.put_line (fnd_file.LOG, 'Calling submit program first stage');
   l_CONC_PROG_SUBMIT :=
      fnd_submit.submit_program (‘XXAP’,
                                 ‘XXAP_FIRST_PROGRAM’,
                                 ‘STAGE10’,
                                 ‘ARGUMENT1’);

   IF (NOT l_CONC_PROG_SUBMIT)
   THEN
      RAISE submitprog_failed;
   END IF;

   l_CONC_PROG_SUBMIT :=
      fnd_submit.submit_program (‘XXAP’,
                                 ‘XXAP_SECOND_PROGRAM’,
                                 ‘STAGE20’);

   IF (NOT l_CONC_PROG_SUBMIT)
   THEN
      RAISE submitprog_failed;
   END IF;

   l_CONC_PROG_SUBMIT :=
      fnd_submit.submit_program (‘XXAP’,
                                 ‘XXAP_THIRD_PROGRAM’,
                                 ‘STAGE30’);

   IF (NOT l_CONC_PROG_SUBMIT)
   THEN
      RAISE submitprog_failed;
   END IF;

   l_CONC_PROG_SUBMIT :=
      fnd_submit.submit_program (‘XXAP’,
                                 ‘XXAP_FOURTH_PROGRAM’,
                                 ‘STAGE40’);

   IF (NOT l_CONC_PROG_SUBMIT)
   THEN
      RAISE submitprog_failed;
   END IF;

   fnd_file.put_line (fnd_file.LOG, 'Calling submit_set');

   --l_start_date is to schedule the request
   SELECT TO_CHAR (SYSDATE, 'DD - MON - YYYY HH24:MI:SS')
     INTO l_start_date
     FROM DUAL;

   req_id :=
      FND_SUBMIT.submit_set (start_time => l_start_date, sub_request => FALSE);

   IF (req_id = 0)
   THEN
      RAISE submitset_failed;
   END IF;
EXCEPTION
   WHEN srs_failed
   THEN
      p_errbuf := 'Call to set_request_set failed: ' || fnd_message.get;
      p_retcode := 2;
      fnd_file.put_line (fnd_file.LOG, p_errbuf);
   WHEN submitprog_failed
   THEN
      p_errbuf := 'Call to submit_program failed: ' || fnd_message.get;
      p_retcode := 2;
      fnd_file.put_line (fnd_file.LOG, p_errbuf);
   WHEN submitset_failed
   THEN
      p_errbuf := 'Call to submit_set failed: ' || fnd_message.get;
      p_retcode := 2;
      fnd_file.put_line (fnd_file.LOG, p_errbuf);
   WHEN OTHERS
   THEN
      p_errbuf := 'Request set submission failed - unknown error: ' || SQLERRM;
      p_retcode := 2;
      fnd_file.put_line (fnd_file.LOG, p_errbuf);
END;

Source: https://oraclesoadiscussion.wordpress.com/2015/03/05/submitting-request-set-from-backend/


*/

1 comment: