DBA Data[Home] [Help]

PACKAGE BODY: APPS.HXC_TKS_SHD

Source


1 Package Body hxc_tks_shd as
2 /* $Header: hxctksrhi.pkb 120.2 2005/09/23 05:29:46 rchennur noship $ */
3 --
4 -- ----------------------------------------------------------------------------
5 -- |                     Private Global Definitions                           |
6 -- ----------------------------------------------------------------------------
7 --
8 g_package  varchar2(33) := '  hxc_tks_shd.';  -- Global package name
9 g_debug boolean := hr_utility.debug_enabled;
10 --
11 -- ----------------------------------------------------------------------------
12 -- |---------------------------< constraint_error >---------------------------|
13 -- ----------------------------------------------------------------------------
14 Procedure constraint_error
15   (p_constraint_name in all_constraints.constraint_name%TYPE
16   ) Is
17 --
18   l_proc        varchar2(72) := g_package||'constraint_error';
19 --
20 Begin
21   --
22 /*  If (p_constraint_name = 'HXC_TK_TIMEKEEPER_SUBMITS_PK1') Then
23     fnd_message.set_name('PAY', 'HR_6153_ALL_PROCEDURE_FAIL');
24     fnd_message.set_token('PROCEDURE', l_proc);
25     fnd_message.set_token('STEP','5');
26     fnd_message.raise_error;
27   Else
28     fnd_message.set_name('PAY', 'HR_7877_API_INVALID_CONSTRAINT');
29     fnd_message.set_token('PROCEDURE', l_proc);
30     fnd_message.set_token('CONSTRAINT_NAME', p_constraint_name);
31     fnd_message.raise_error;
32   End If;
33   */
34   null;
35   --
36 End constraint_error;
37 --
38 -- ----------------------------------------------------------------------------
39 -- |-----------------------------< api_updating >-----------------------------|
40 -- ----------------------------------------------------------------------------
41 Function api_updating
42   (p_submission_id                        in     number
43   )
44   Return Boolean Is
45   --
46   --
47   -- Cursor selects the 'current' row from the HR Schema
48   --
49   Cursor C_Sel1 is
50     select
51        submission_id
52       ,resource_id
53     from        hxc_tk_timekeeper_submits
54     where       submission_id = p_submission_id;
55   --
56   l_fct_ret     boolean;
57   --
58 Begin
59   --
60   If (p_submission_id is null ) Then
61     --
62     -- One of the primary key arguments is null therefore we must
63     -- set the returning function value to false
64     --
65     l_fct_ret := false;
66   Else
67     If (p_submission_id
68         = hxc_tks_shd.g_old_rec.submission_id
69        ) Then
70       --
71       -- The g_old_rec is current therefore we must
72       -- set the returning function to true
73       --
74       l_fct_ret := true;
75     Else
76       --
77       -- Select the current row into g_old_rec
78       --
79       Open C_Sel1;
80       Fetch C_Sel1 Into hxc_tks_shd.g_old_rec;
81       If C_Sel1%notfound Then
82         Close C_Sel1;
83         --
84         -- The primary key is invalid therefore we must error
85         --
86         fnd_message.set_name('PAY', 'HR_7220_INVALID_PRIMARY_KEY');
87         fnd_message.raise_error;
88       End If;
89       Close C_Sel1;
90       --
91       l_fct_ret := true;
92     End If;
93   End If;
94   Return (l_fct_ret);
95 --
96 End api_updating;
97 --
98 -- ----------------------------------------------------------------------------
99 -- |---------------------------------< lck >----------------------------------|
100 -- ----------------------------------------------------------------------------
101 Procedure lck
102   (p_submission_id                        in     number
103   ) is
104 --
105 -- Cursor selects the 'current' row from the HR Schema
106 --
107   Cursor C_Sel1 is
108     select
109        submission_id
110       ,resource_id
111     from        hxc_tk_timekeeper_submits
112     where       submission_id = p_submission_id
113     for update nowait;
114 --
115   l_proc        varchar2(72) ;
116 --
117 Begin
118   g_debug :=hr_utility.debug_enabled;
119   if g_debug then
120   	l_proc := g_package||'lck';
121   	hr_utility.set_location('Entering:'||l_proc, 5);
122   end if;
123   --
124   hr_api.mandatory_arg_error
125     (p_api_name           => l_proc
126     ,p_argument           => 'SUBMISSION_ID'
127     ,p_argument_value     => p_submission_id
128     );
129   --
130   Open  C_Sel1;
131   Fetch C_Sel1 Into hxc_tks_shd.g_old_rec;
132   If C_Sel1%notfound then
133     Close C_Sel1;
134     --
135     -- The primary key is invalid therefore we must error
136     --
137 --    fnd_message.set_name('PAY', 'HR_7220_INVALID_PRIMARY_KEY');
138   --  fnd_message.raise_error;
139   null;
140 
141   End If;
142   Close C_Sel1;
143   --
144   --
145   if g_debug then
146   	hr_utility.set_location(' Leaving:'||l_proc, 10);
147   end if;
148   --
149   -- We need to trap the ORA LOCK exception
150   --
151 Exception
152   When HR_Api.Object_Locked then
153     --
154     -- The object is locked therefore we need to supply a meaningful
155     -- error message.
156     --
157     fnd_message.set_name('PAY', 'HR_7165_OBJECT_LOCKED');
158     fnd_message.set_token('TABLE_NAME', 'hxc_tk_timekeeper_submits');
159     fnd_message.raise_error;
160 End lck;
161 --
162 -- ----------------------------------------------------------------------------
163 -- |-----------------------------< convert_args >-----------------------------|
164 -- ----------------------------------------------------------------------------
165 Function convert_args
166   (p_submission_id                  in number
167   ,p_resource_id                    in number
168   )
169   Return g_rec_type is
170 --
171   l_rec   g_rec_type;
172 --
173 Begin
174   --
175   -- Convert arguments into local l_rec structure.
176   --
177   l_rec.submission_id                    := p_submission_id;
178   l_rec.resource_id                      := p_resource_id;
179   --
180   -- Return the plsql record structure.
181   --
182   Return(l_rec);
183 --
184 End convert_args;
185 --
186 end hxc_tks_shd;