[Home] [Help]
PACKAGE BODY: APPS.GML_POCR
Source
1 PACKAGE BODY GML_POCR AS
2 /* $Header: GMLPOCRB.pls 115.4 1999/12/02 10:17:07 pkm ship $ */
3 PROCEDURE gmlpocr(errbufx OUT VARCHAR2, retcode OUT VARCHAR2) IS
4
5
6 flag number := 0;
7
8 err_num NUMBER;
9 err_msg VARCHAR2(100);
10 errbuf VARCHAR2(100);
11 v_request_id number;
12 r_retcode number;
13 s_retcode number;
14 b_retcode number;
15 validation_error EXCEPTION;
16 dist_flag varchar2(1) := 'N';
17
18 CURSOR DIST_CUR IS
19 SELECT 'Y'
20 FROM all_db_links
21 WHERE db_link='GEMMS_DB.WORLD';
22
23 BEGIN
24
25 --FND_FILE.PUT_NAMES('testx.log','testx.out','/tmp');
26 FND_FILE.PUT_LINE(FND_FILE.LOG, 'Common Purchasing Error Log File');
27 FND_FILE.PUT_LINE(FND_FILE.OUTPUT, 'Common Purchasing Output File');
28 FND_FILE.PUT_LINE(FND_FILE.LOG, 'Date : '|| to_char(sysdate,'DD-MON-YYYY hh24:mi:ss'));
29 FND_FILE.NEW_LINE(FND_FILE.LOG, 2);
30
31
32 /* Call the Blanket PO Synchronization Routine */
33
34 gml_synch_bpos.cpg_bint2gms( b_retcode );
35
36 /* Call the Standard PO Synchronization Routine */
37
38 gml_po_synch.cpg_int2gms( s_retcode);
39
40 /* Call the Receipt Synronization Routine */
41
42 /*
43 gml_po_recv.cpg_recvmv(r_retcode );
44
45 */
46
47
48 IF ((b_retcode = 1) OR (s_retcode = 1) OR (r_retcode=1)) THEN
49 fnd_profile.put('b_retcode=',b_retcode);
50 fnd_profile.put('s_retcode=',s_retcode);
51 /*
52 fnd_profile.put('r_retcode=',r_retcode);
53 */
54
55 retcode := 1;
56 IF b_retcode = 1 THEN
57 errbufx := 'gml_synch_bpos.cpg_bint2gms returned 1';
58 END IF;
59 IF s_retcode = 1 THEN
60 errbufx := 'gml_po_synch.cpg_int2gms returned 1';
61 END IF;
62 /*
63 IF r_retcode = 1 THEN
64 errbufx := 'cpg_po_recv.cpg_recvmv returned 1';
65 END IF;
66 */
67 RAISE validation_error;
68 END IF;
69
70 -- This Procedure Will only be Called under Distributed Instance Scenario
71 -- Make sure the following parameters are set to ensure SNP background
72 -- processes are available.
73 -- JOB_QUEUE_PROCESSES = 1 (must have a least on SNP backgrond process)
74 -- JOB_QUEUE_INTERVAL = 60 (default)
75
76 OPEN DIST_CUR;
77 FETCH DIST_CUR INTO dist_flag;
78 IF (dist_flag = 'Y') THEN
79 gml_dummy.cpg_oragems_mapping_refresh;
80 END IF;
81 CLOSE DIST_CUR;
82
83 exception
84 when utl_FILE.INVALID_PATH THEN
85 -- dbms_output.put_line('Invalid Path....');
86 errbufx := 'Invalid path - '||to_char(SQLCODE) || ' ' || SQLERRM;
87 when utl_FILE.INVALID_MODE THEN
88 -- dbms_output.put_line('Invalid Mode ....');
89 errbufx := 'Invalid Mode - '||to_char(SQLCODE) || ' ' || SQLERRM;
90 when utl_file.invalid_filehandle then
91 errbufx := 'Invalid filehandle - '||to_char(SQLCODE) || ' ' || SQLERRM;
92
93 when utl_FILE.INVALID_OPERATION THEN
94 -- dbms_output.put_line('Invalid Operation....');
95 errbufx := 'Invalid operation - '||to_char(SQLCODE) || ' ' || SQLERRM;
96 when utl_file.write_error then
97 errbufx := 'Write error - '||to_char(SQLCODE) || ' ' || SQLERRM;
98
99 when validation_error then
100 -- dbms_output.put_line('Validation Errors Detected....');
101 FND_FILE.PUT_LINE(FND_FILE.LOG,'Validation Errors Detected...');
102 errbufx := 'Validation error - '||to_char(SQLCODE) || ' ' || SQLERRM;
103 flag := 1;
104
105 when others then
106 err_num := SQLCODE;
107 err_msg := SQLERRM(err_num);
108 -- dbms_output.put_line( ' In others');
109 -- dbms_output.put_line('Unhandled Exception....');
110 -- dbms_output.put_line(err_num || ' ' || err_msg);
111 FND_FILE.PUT_LINE(FND_FILE.LOG,'Validation Errors Detected...');
112 FND_FILE.PUT_LINE(FND_FILE.LOG, err_msg);
113 errbufx := to_char(SQLCODE) || ' ' || SQLERRM;
114
115 raise;
116 /*
117 DECLARE
118 validation_error EXCEPTION;
119 BEGIN
120 IF flag = 1
121 THEN
122 RAISE validation_error;
123 END IF;
124
125 EXCEPTION
126 WHEN validation_error THEN
127 RAISE;
128 WHEN others THEN
129 RAISE;
130 END;
131 */
132 END GMLPOCR;/* procedure GMLPOCR */
133
134 END GML_POCR; /* package */