Sunday, October 04, 2015

Submitting XML Report using FND_REQUEST.SUBMIT_REQUEST

If you submit the concurrent Program (XML Report) from backend usingFND_REQUEST.SUBMIT_REQUEST, it will not take Attached Template(Layout) to the Concurrent Program. For this, we need to add Layout Explicitly using FND_REQUEST.ADD_LAYOUT before submitting the Concurrent Program (XML Report).


Sample Code:


DECLARE
   l_request_id               NUMBER;
   l_option_return            BOOLEAN;
BEGIN
   fnd_global.apps_initialize (user_id           => fnd_global.user_id,
                               resp_id           => fnd_global.resp_id,
                               resp_appl_id      => fnd_global.resp_appl_id
                              );
   l_option_return :=
      fnd_request.add_layout (template_appl_name      => 'SQLAP', --Application Short Name
             template_code           => 'XX_ABC_FORMAT', --Template Code
                              template_language       => 'En',
                              template_territory      => '00',
                              output_format           => 'PDF'
                             );
   /* Setting Printer Options , if we want print output of the Concurrent Program on Particular Printer*/
   l_option_return :=
      fnd_request.set_print_options (printer             => 'noprint',
                                     style               => 'LANDSCAPE',
                                     copies              => 1,
                                     save_output         => TRUE,
                                     print_together      => 'N'
                                    );
   l_request_id := fnd_request.submit_request (
        'SQLAP' ,
        'XX_ABC_SAMPLE_RDF' ,
        'SAMPLE REPORT',
        null,
        FALSE,
        CHR(0),
               CHR(0),
        CHR(0),
        CHR(0),
        CHR(0),
        CHR(0),
        CHR(0),
        CHR(0),
        CHR(0),
        CHR(0),
        CHR(0),
        CHR(0),
        CHR(0),
        CHR(0),
        CHR(0),
        CHR(0),
        CHR(0),
        CHR(0),
        CHR(0),
        CHR(0),
        CHR(0),
        CHR(0),
        CHR(0),
        CHR(0),
        CHR(0),
        CHR(0),
        CHR(0),
        CHR(0),
        CHR(0),
        CHR(0),
        CHR(0),
        CHR(0),
        CHR(0),
        CHR(0),
        CHR(0),
        CHR(0),
        CHR(0),
        CHR(0),
        CHR(0),
        CHR(0),
        CHR(0),
        CHR(0),
        CHR(0),
        CHR(0),
        CHR(0),
        CHR(0),
        CHR(0),
        CHR(0),
        CHR(0),
        CHR(0),
        CHR(0),
          CHR(0),
        CHR(0),
        CHR(0),
        CHR(0),
        CHR(0),
        CHR(0),
        CHR(0),
        CHR(0),
        CHR(0),
        CHR(0),
        CHR(0),
        CHR(0),
        CHR(0),
        CHR(0),
        CHR(0),
        CHR(0),
        CHR(0),
        CHR(0),
        CHR(0),
        CHR(0),
        CHR(0),
        CHR(0),
        CHR(0),
        CHR(0),
        CHR(0),
        CHR(0),
        CHR(0),
        CHR(0),
        CHR(0),
        CHR(0),
        CHR(0),
        CHR(0),
        CHR(0),
        CHR(0),
        CHR(0),
        CHR(0),
        CHR(0),
        CHR(0),
        CHR(0),
        CHR(0),
        CHR(0),
        CHR(0),
        CHR(0),
        CHR(0),
        CHR(0),
        CHR(0),
        CHR(0),
        CHR(0),
        CHR(0));
   IF l_request_id = 0 THEN
    FND_MESSAGE.SET_STRING('Cannot Submit Request') ;
     FND_MESSAGE.SHOW;
   ELSE
  FND_MESSAGE.SET_STRING('Submitting Job to Run: SAMPLE REPORT . Look at Request ID: '||to_char(l_request_id)) ;
     FND_MESSAGE.SHOW;
     FORMS_DDL('commit');
   END IF;
END;

No comments:

Post a Comment

Clear BNE Cache for WebADI Changes

It Sometime happens that WebAdi Changes doesn't reflect once migrated in controlled instances. Here are the quick steps(Generally perfor...