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