Sample Text

How To Submit a Concurrent Program From Back End ?


SET SERVEROUTPUT ON;
DECLARE
    v_request_id                        NUMBER ;
    l_user_id                           NUMBER ;
    l_resp_id                           NUMBER 
    l_resp_appl_id                      NUMBER;
BEGIN
      -- Setting the context ----
   BEGIN
      SELECT fnd.user_id ,  fresp.responsibility_id,fresp.application_id,
               FROM fnd_user fnd ,fnd_responsibility_tl fresp
             WHERE fnd.user_name = 'HCM'
             AND fresp.responsibility_name LIKE 'US%';     
      FND_GLOBAL.APPS_INITIALIZE(l_user_id,l_resp_id,l_resp_appl_id);
       
                  
   EXCEPTION
     WHEN OTHERS
      THEN
        DBMS_OUTPUT.PUT_LINE('ERROR IN INITIALIZING SESSION :'||SQLERRM);
   END;
    
      v_request_id:=  FND_REQUEST.SUBMIT_REQUEST (
               application  =>  'XXFU'
              ,program      =>  'Ritesh_Supplier_Invoice_Workflow'
              ,description  =>  'Ritesh_Supplier_Invoice_Workflow'
              ,start_time   =>  SYSDATE
              ,sub_request  =>  NULL
             );

       COMMIT;

       DBMS_OUTPUT.PUT_LINE('Request_id: '||v_request_id);

EXCEPTION WHEN OTHERS THEN        
       DBMS_OUTPUT.PUT_LINE(SQLCODE||' Error :'||SQLERRM);
END;


No comments:

Post a Comment

Contact Form

Name

Email *

Message *