How to submitt XMLP Report using a PL/SQL Script

By | July 3, 2013 | 3,519 views | Category: AOL SQL Scripts XMLP Tags:

Generally we use FND_REQUEST.SUBMIT_REQUEST to submit a concurrent program using a PL/SQL script. But we can not attach a layout to the concurrent request using the above said API.

We can attach a layout to the concurrent request by using another procedure ADD_LAYOUT which belongs to the same package FND_REQUEST

Below is the signature of the procedure ADD_LAYOUT:

fnd_request.add_layout (
template_appl_name  => 'Template Application',
template_code       => 'Template Code',
template_language   => 'en', --Use language from template definition
template_territory  => 'US', --Use territory from template definition
output_format       => 'PDF' --Use output format from template definition
);

Note:

  1. ADD_LAYOUT procedure should be called only when there is a layout associated to a concurrent program
  2. Session context should be set using ‘FND_GLOBAL.APPS_INITIALIZE’ before calling the ADD_LAYOUT procedure

Example:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
DECLARE
--
l_responsibility_id 	NUMBER;
l_application_id    	NUMBER;
l_user_id           	NUMBER;
l_request_id            NUMBER;
l_layout                NUMBER;
--
BEGIN
  --
  SELECT DISTINCT fr.responsibility_id,
    frx.application_id
     INTO l_responsibility_id,
    l_application_id
     FROM apps.fnd_responsibility frx,
    apps.fnd_responsibility_tl fr
    WHERE fr.responsibility_id = frx.responsibility_id
  AND LOWER (fr.responsibility_name) LIKE LOWER('XXTest Resp');
  --
   SELECT user_id INTO l_user_id FROM fnd_user WHERE user_name = 'STHALLAM';
  --
  --To set environment context.
  --
  apps.fnd_global.apps_initialize (l_user_id,l_responsibility_id,l_application_id);
  --
  --Setting Layout for the Request
  --
  l_layout := apps.fnd_request.add_layout(
                            template_appl_name => 'XXCUST',
                            template_code      => 'XXEMP',
                            template_language  => 'en',
                            template_territory => 'US',
                            output_format      => 'EXCEL');
  --
  --Submitting Concurrent Request
  --
  l_request_id := fnd_request.submit_request ( 
                            application   => 'XXCUST', 
                            program       => 'XXEMP', 
                            description   => 'XXTest Employee Details', 
                            start_time    => sysdate, 
                            sub_request   => FALSE,
			    argument1     => 'Smith'
  );
  --
  COMMIT;
  --
  IF l_request_id = 0
  THEN
     dbms.output.put_line ('Concurrent request failed to submit');
  ELSE
     dbms_output.put_line('Successfully Submitted the Concurrent Request');
  END IF;
  --
EXCEPTION
WHEN OTHERS THEN
  dbms_output.put_line('Error While Submitting Concurrent Request '||TO_CHAR(SQLCODE)||'-'||SQLERRM);
END;
/
WOW! Did you like this post? We'll send more interesting posts like How to submitt XMLP Report using a PL/SQL Script to you!
Enter your Email Address:
  • Ganesh

    Merhaba,

    Allow me to show my gratitude
    bloggers. You guys are like unicorns. Never seen but always spreading
    magic. Your content is yummy. So satisfied.

    I have one table

    Number Re_Number Text

    11 1 Aruna

    11 2 Aruna

    13 10 *

    15 2 /

    15 6 /

    17 1 Aruna

    18 1 &

    18 2 MSBI

    18 3 &

    19 11 %

    I need Duplicate records(Text) that also based on Number example above table

    Aruna is duplicate record but i need display only Number 11(becoz..Number
    column rows should be mach 11,11 rows mached,

    17 and row not mached 17 row not required

    18 Number two & mached but MSBI is there this is also not required)

    out put should be like

    11 1 Aruna

    11 2 Aruna

    15 2 /

    15 6 /

    only display special characters rows not multiple Number
    Columns

    example out put

    13 10 *

    19 11 %

    But great job man, do keep posted with the
    new
    updates.

    Obrigado,