Skip to main content

Main Query to get the schedule of any conncurrent program

Main Query to get the schedule of any conncurrent program


---------------------------------------------------------------------------------------------------

SELECT   r.request_id,
            p.user_concurrent_program_name
         || NVL2 (r.description, ' (' || r.description || ')', NULL)
                                                                    conc_prog,
         s.user_name requestor, r.argument_text arguments,
         r.requested_start_date next_run, r.last_update_date last_run,
         r.hold_flag on_hold, r.increment_dates,
         DECODE (c.class_type,
                 'P', 'Periodic',
                 'S', 'On Specific Days',
                 'X', 'Advanced',
                 c.class_type
                ) schedule_type,
         CASE
            WHEN c.class_type = 'P'
               THEN    'Repeat every '
                    || SUBSTR (c.class_info, 1, INSTR (c.class_info, ':') - 1)
                    || DECODE (SUBSTR (c.class_info,
                                       INSTR (c.class_info, ':', 1, 1) + 1,
                                       1
                                      ),
                               'N', ' minutes',
                               'M', ' months',
                               'H', ' hours',
                               'D', ' days'
                              )
                    || DECODE (SUBSTR (c.class_info,
                                       INSTR (c.class_info, ':', 1, 2) + 1,
                                       1
                                      ),
                               'S', ' from the start of the prior run',
                               'C', ' from the completion of the prior run'
                              )
            WHEN c.class_type = 'S'
               THEN    NVL2 (dates.dates,
                             'Dates: ' || dates.dates || '. ',
                             NULL
                            )
                    || DECODE (SUBSTR (c.class_info, 32, 1),
                               '1', 'Last day of month '
                              )
                    || DECODE (SIGN (TO_NUMBER (SUBSTR (c.class_info, 33))),
                               '1', 'Days of week: '
                                || DECODE (SUBSTR (c.class_info, 33, 1),
                                           '1', 'Su '
                                          )
                                || DECODE (SUBSTR (c.class_info, 34, 1),
                                           '1', 'Mo '
                                          )
                                || DECODE (SUBSTR (c.class_info, 35, 1),
                                           '1', 'Tu '
                                          )
                                || DECODE (SUBSTR (c.class_info, 36, 1),
                                           '1', 'We '
                                          )
                                || DECODE (SUBSTR (c.class_info, 37, 1),
                                           '1', 'Th '
                                          )
                                || DECODE (SUBSTR (c.class_info, 38, 1),
                                           '1', 'Fr '
                                          )
                                || DECODE (SUBSTR (c.class_info, 39, 1),
                                           '1', 'Sa '
                                          )
                              )
         END AS schedule,
         c.date1 start_date, c.date2 end_date, c.class_info
    FROM fnd_concurrent_requests r,
         fnd_conc_release_classes c,
         fnd_concurrent_programs_tl p,
         fnd_user s,
         (WITH date_schedules AS
               (SELECT release_class_id,
                       RANK () OVER (PARTITION BY release_class_id ORDER BY s)
                                                                            a,
                       s
                  FROM (SELECT c.class_info, l, c.release_class_id,
                               DECODE (SUBSTR (c.class_info, l, 1),
                                       '1', TO_CHAR (l)
                                      ) s
                          FROM (SELECT     LEVEL l
                                      FROM DUAL
                                CONNECT BY LEVEL <= 31),
                               fnd_conc_release_classes c
                         WHERE c.class_type = 'S'
                           AND INSTR (SUBSTR (c.class_info, 1, 31), '1') > 0)
                 WHERE s IS NOT NULL)
          SELECT     release_class_id,
                     SUBSTR (MAX (SYS_CONNECT_BY_PATH (s, ' ')), 2) dates
                FROM date_schedules
          START WITH a = 1
          CONNECT BY NOCYCLE PRIOR a = a - 1
            GROUP BY release_class_id) dates
   WHERE r.phase_code = 'P'
     AND c.application_id = r.release_class_app_id
     AND c.release_class_id = r.release_class_id
     AND NVL (c.date2, SYSDATE + 1) > SYSDATE
     AND c.class_type IS NOT NULL
     AND p.concurrent_program_id = r.concurrent_program_id
     AND p.LANGUAGE = 'US'
     AND dates.release_class_id(+) = r.release_class_id
     AND r.requested_by = s.user_id
     AND p.USER_CONCURRENT_PROGRAM_NAME like 'Purge Concurrent Request and/or Manager Data'
   --  AND r.request_id = 9286556
ORDER BY conc_prog, on_hold, next_run;

---------------------------------------------------------------------------------------------------

Comments

Popular posts from this blog

FND_PROFILE API In Oracle Apps

 FND_PROFILE API In Oracle Apps --------------------------------------------------------------------------------------------------- FND_PROFILE API is used very frequently in oracle apps development. The major purpose of this API is to: ·                      Retrieve user profile values for the current run-time environment ·                      Set user profile values for the current run-time environment FND_PROFILE API has different procedures and functions which are most frequently used. Following are the brief explanation of them: 1. FND_PROFILE.PUT:  This can be used to put a value to the specified user profile option. Example:  FND_Profile.Put(‘PROFILE_NAME’, ‘New_Value’) FND_Profile.Put(’USERNAME’, Usr_Name) FND_Profile.Pu...

PO Matching Setting in Purchase Order Shipment Line(2-way,3-way,4-way)

[PO] Matching Setting in Purchase Order Shipment Line Invoice matching can be set in five different areas of Oracle Purchasing: In the list below, a setting at any level will override the settings above it. 1. Oracle Purchasing Options a. Navigate to: Setup > Organizations > Purchasing Options b. Select Default Alternative Region 2. Supplier Information a. Navigate to: Supply Base > Suppliers b. Query on specific supplier c. Click on Open d. Select Receiving Alternative Region 3. Line Types a. Navigate to: Setup > Purchasing > Line Types b. In the Receipt Required field: Yes = 3-way, No = 2-way 4. Items a. Navigate to: Items > Master Items b. Query on specific item c. Select Purchasing Alternative Region d. In the Invoice Matching section: Yes = 3-way, No = 2-way 5. Purchase Order Shipments a. Navigate to: Purchase Orders > Purchase Orders b. Enter (header and) line information c. Click on Shipments button d. Select More Alternative Region Ramification of Invoice ...

To make the program to complete with warning. Through sql

 To make the program to complete with warning. Through sql -------------------------------------------------------------------------------------------------------------------------------------- l_submit_status:=FND_CONCURRENT.SET_COMPLETION_STATUS('WARNING',NULL); --------------------------------------------------------------------------------------------------------------------------------------