Follow us: Subscribe via RSS Feed Connect on YouTube Connect on YouTube

Pages

Wednesday, 28 December 2016

Add Concurrent Program to Request Group From Backend

DECLARE
 l_program_appl_name    VARCHAR2(100);
 l_program_short_name   VARCHAR2(100);
 l_program_name         VARCHAR2(100);
BEGIN    
       l_program_name       :=  'Concurrent Program Name';
       l_program_appl_name  :=  'Receivables';
       l_program_short_name :=  'CONCURRENT_PROGRAM_SHORT_NAME';
  
   FOR i IN (SELECT DISTINCT frg.request_group_name
                    ,( SELECT application_name
                         FROM apps.fnd_application_tl
                        WHERE application_id = frg.application_id
                          AND language='US') aplication_name
                FROM  apps.FND_REQUEST_GROUPS frg
                    , apps.FND_REQUEST_GROUP_UNITS frgu
                    , apps.fnd_concurrent_programs_tl fcp
                    , apps.FND_RESPONSIBILITY_VL frv
               WHERE  frg.request_group_id = frgu.request_group_id
                 AND  frgu.request_unit_id = fcp.concurrent_program_id
                 AND  upper(frv.RESPONSIBILITY_NAME) like '%AR%CE%MANAGER%'
                 AND  fcp.language = 'US'
                 AND  frv.request_group_id = frg.request_group_id)
   LOOP     
          BEGIN       
              FND_PROGRAM.ADD_TO_GROUP(  program_short_name  => l_program_short_name
                                       , program_application => l_program_appl_name
                                       , request_group       => i.request_group_name
                                       , group_application   => i.aplication_name);
              COMMIT;
              DBMS_OUTPUT.PUT_LINE('The Program: "'||l_program_name||'"  Successfully added to the Request Group: '||i.request_group_name);
           EXCEPTION
             WHEN OTHERS THEN
                  DBMS_OUTPUT.PUT_LINE('Failed - While Adding The Program: "'||l_program_name||'" To a Request Group: '||i.request_group_name);
          END;   
   END LOOP;              
END;
Share this article :

0 comments:

Post a Comment