[Home] [Help]
PACKAGE BODY: APPS.PA_PURGE_EXTN_VALIDATE
Source
1 package body pa_purge_extn_validate as
2 /* $Header: PAXAPVXB.pls 120.1 2005/08/19 17:08:28 mwasowic noship $ */
3
4 -- forward declarations
5
6 procedure validate_extn ( p_project_id in NUMBER,
7 p_txn_through_date in DATE,
8 p_active_flag in VARCHAR2,
9 x_err_code in OUT NOCOPY NUMBER, --File.Sql.39 bug 4440895
10 x_err_stack in OUT NOCOPY VARCHAR2, --File.Sql.39 bug 4440895
11 x_err_stage in OUT NOCOPY VARCHAR2 ) is --File.Sql.39 bug 4440895
12
13
14 -- cursor <CURSOR_VALIDATE> is
15 -- select 'CURSOR VALID '
16 -- from dual
17 -- where exists ( select ei.expenditure_item_id
18 -- from pa_expenditure_items_all ei,
19 -- pa_project_types_all pt,
20 -- pa_tasks t,
21 -- pa_projects_all p
22 -- where ei.task_id = t.task_id
23 -- and t.project_id = p.project_id
24 -- and t.project_id = p_project_id
25 -- and p.project_type = pt.project_type
26 -- and nvl(pt.org_id, -99) = nvl(p.org_id, -99)
27 -- and pt.burden_cost_flag = 'Y'
28 -- and ( p_active_flag != 'Y'
29 -- or (trunc(ei.expenditure_item_date ) < trunc(p_txn_through_date ) ))) ;
30 --
31 -- Note : The parameter p_txn_through_date includes transactions through a
32 -- given date. However, the archive/purge code and tables refer to
33 -- this parameter as txn_to_date
34 --
35
36 l_err_stack_old VARCHAR2(2000);
37 l_err_stack VARCHAR2(2000);
38 l_err_stage VARCHAR2(500);
39 l_err_code NUMBER ;
40 l_dummy VARCHAR2(500);
41
42 BEGIN
43 -- l_err_code := 0 ;
44 -- l_err_stack_old := x_err_stack;
45
46
47 -- Check if total burden cost distribution is run for the costs
48
49 -- Open <CURSOR_VALIDATE> ;
50 -- Fetch <CURSOR_VALIDATE> into l_dummy ;
51 -- If l_dummy is not null then
52 -- fnd_message.set_name('PA', '<CURSOR_VALIDATE_ERROR>');
53 -- fnd_msg_pub.add;
54 --
55 -- x_err_stage := 'After cursor validate error check ' ;
56 -- x_err_stack := x_err_stack || ' ->After cursor validate error check ' ;
57 -- pa_debug.debug(' * Cursor validate error for project '||to_char(x_project_id));
58 -- End If;
59 -- close <CURSOR_VALIDATE>
60 -- l_dummy := NULL;
61 --
62 -- EXAMPLE:
63 --
64 -- Check if total burden cost distribution is run for the costs
65 --
66 -- Open IsBurdenDistributed ;
67 -- Fetch IsBurdenDistributed into l_dummy ;
68 -- If l_dummy is not null then
69 -- fnd_message.set_name('PA', 'PA_ARPR_NOT_BRDN_DIST');
70 -- fnd_msg_pub.add;
71 -- l_err_code := 10 ;
72 --
73 -- l_err_stage := 'After Burden Cost Dist. check ' ;
74 -- l_err_stack := l_err_stack || ' ->After Burden Cost Dist. check ' ;
75 -- pa_debug.debug(' * Not all costs are burden distributed for project '
76 -- ||to_char(p_project_id));
77 -- End If;
78 -- close IsBurdenDistributed;
79 -- l_dummy := NULL;
80 --
81 --
82
83 NULL ;
84
85 -- x_err_stage := l_err_stage ;
86 -- x_err_stack := l_err_stack_old ;
87
88 EXCEPTION
89 WHEN PA_PROJECT_UTILS2.PA_Arch_Pur_Subroutine_Error then
90 RAISE PA_PROJECT_UTILS2.PA_Arch_Pur_Subroutine_Error ;
91
92 WHEN OTHERS THEN
93 pa_debug.debug('Error Procedure Name := PA_PURGE_EXTN_VALIDATE.VALIDATE_EXTN' );
94 pa_debug.debug('Error stage is '||x_err_stage );
95 pa_debug.debug('Error stack is '||x_err_stack );
96 pa_debug.debug(SQLERRM);
97 PA_PROJECT_UTILS2.g_sqlerrm := SQLERRM ;
98
99 RAISE PA_PROJECT_UTILS2.PA_Arch_Pur_Subroutine_Error ;
100
101 END validate_extn ;
102
103 END pa_purge_extn_validate ;