Friday, March 20, 2015

Submitting the XMLP Report with Attachment from Backend

DECLARE
    V_REQUEST_ID NUMBER;
    l_boolean      BOOLEAN;
    l_boolean1     BOOLEAN;
BEGIN
    l_boolean := FND_REQUEST.ADD_DELIVERY_OPTION
               (TYPE          => 'E', -- this one to specify the delivery option as Email
                p_argument1  => 'Testing the Email option from back end', -- subject for the mail
                p_argument2  => 'raju.chinthapatla@oracleapps88.com', -- from address
                p_argument3  => 'raju.chinthapatla@oracleapps88.com', -- to address
                p_argument4  => 'raju.chinthapatla@oracleapps88.com', -- cc address to be specified here.
                nls_language => '' -- language option
               );         
       
    IF l_boolean = TRUE
    THEN
        FND_GLOBAL.APPS_INITIALIZE(8511,51272,20003);
        l_boolean1 := FND_REQUEST.add_layout
                        (template_appl_name   => 'XXAA'
                         ,template_code       => 'XXAAPTOSUEMP'
                         ,template_language   => 'en'
                         ,template_territory  => 'US'
                         ,output_format       => 'PDF'
                        );                      
          
      IF l_boolean = TRUE
      THEN
        V_REQUEST_ID := FND_REQUEST.SUBMIT_REQUEST
                           (APPLICATION   => 'XXAA'   
                            ,PROGRAM      => 'XXAAPTOSUEMP'
                           );   
                           
        COMMIT ;
        DBMS_OUTPUT.PUT_LINE('Request submitted. V_REQUEST_ID = ' || V_REQUEST_ID);
      END IF;              
    END IF;

EXCEPTION
  WHEN OTHERS THEN
    DBMS_OUTPUT.PUT_LINE('Request set submission failed - unknown error: ' ||SQLERRM);

END;

No comments:

Post a Comment

Best Blogger TipsGet Flower Effect