DBA Data[Home] [Help]

PACKAGE BODY: APPS.AST_GRP_CAMP_PUB

Source


1 PACKAGE BODY ast_grp_camp_PUB as
2 /* $Header: astpgcab.pls 115.3 2002/02/05 18:04:02 pkm ship      $ */
3 -- Start of Comments
4 -- Package name     : ast_grp_camp_PUB
5 -- Purpose          :
6 -- History          :
7 -- NOTE             :
8 -- End of Comments
9 
10 
11 G_PKG_NAME CONSTANT VARCHAR2(30):= 'ast_grp_camp_PUB';
12 G_FILE_NAME CONSTANT VARCHAR2(12) := 'astpgcab.pls';
13 
14 -- Start of Comments
15 -- ***************** Private Conversion Routines Values -> Ids **************
16 -- Purpose
17 --
18 -- This procedure takes a public grp_camp record as input. It may contain
19 -- values or ids. All values are then converted into ids and a
20 -- private grp_camprecord is returned for the private
21 -- API call.
22 --
23 -- Conversions:
24 --
25 -- Notes
26 --
27 -- 1. IDs take precedence over values. If both are present for a field, ID is used,
28 --    the value based parameter is ignored and a warning message is created.
29 -- 2. This is automatically generated procedure, it converts public record type to
30 --    private record type for all attributes.
31 --    Developer must manually add conversion logic to the attributes.
32 --
33 -- End of Comments
34 PROCEDURE Convert_grp_camp_Values_To_Ids(
35          P_grp_camp_Rec        IN   ast_grp_camp_PUB.grp_camp_Rec_Type,
36          x_pvt_grp_camp_rec    OUT   ast_grp_camp_PVT.grp_camp_Rec_Type
37 )
38 IS
39 -- Hint: Declare cursor and local variables
40 -- Example: CURSOR C_Get_Lookup_Code(X_Lookup_Type VARCHAR2, X_Meaning VARCHAR2) IS
41 --          SELECT lookup_code
42 --          FROM   as_lookups
43 --          WHERE  lookup_type = X_Lookup_Type and nls_upper(meaning) = nls_upper(X_Meaning);
44 l_any_errors       BOOLEAN   := FALSE;
45 BEGIN
46   -- Hint: Add logic to process value-id verification for grp_camp record.
47   --       Value based parameters should be converted to their equivalent ids.
48   --       Each value should resolve into one and only one id.
49   --       If this condition is not satisfied, API must report an error and assign l_any_errors to TRUE.
50   -- Example: Process Lead Source/Lead Source Code
51   -- If(p_opp_rec.lead_source_code is NOT NULL and p_opp_rec.lead_source_code <> FND_API.G_MISS_CHAR)
52   -- THEN
53   --     p_pvt_opp_rec.lead_source_code := p_opp_rec.lead_source_code;
54   --     IF(p_opp_rec.lead_source is NOT NULL and p_opp_rec.lead_source <> FND_API.G_MISS_CHAR)
55   --     THEN
56   --         IF FND_MSG_PUB.Check_Msg_Level(FND_MSG_PUB.G_MSG_LVL_SUCCESS)
57   --         THEN
58   --             FND_MESSAGE.Set_Name('AS','API_ATTRIBUTE_IGNORED');
59   --             FND_MESSAGE.Set_Token('COLUMN','LEAD_SOURCE',FALSE);
60   --             FND_MSG_PUB.Add;
61   --         END IF;
62   --     END IF;
63   -- ELSIF(p_opp_rec.lead_source is NOT NULL and p_opp_rec.lead_source <> FND_API.G_MISS_CHAR)
64   -- THEN
65   --     OPEN C_Get_Lookup_Code('LEAD_SOURCE', p_opp_rec.lead_source);
66   --     FETCH C_Get_Lookup_Code INTO l_val;
67   --     CLOSE C_Get_Lookup_Code;
68   --     p_pvt_opp_rec.lead_source_code := l_val;
69   --     IF(l_val IS NULL)
70   --     THEN
71   --         IF FND_MSG_PUB.Check_Msg_Level(FND_MSG_PUB.G_MSG_LVL_ERROR)
72   --         THEN
73   --             FND_MESSAGE.Set_Name('AS','API_ATTRIBUTE_CONVERSION_ERROR'
74   --             FND_MESSAGE.Set_Token('COLUMN','LEAD_SOURCE', FALSE
75   --             FND_MESSAGE.Set_Token('VALUE', p_opp_rec.lead_source, FALSE
76   --             FND_MSG_PUB.Add;
77   --         END IF;
78   --         l_any_errors := TRUE;
79   --     END IF;
80   -- ELSE
81   --     p_pvt_opp_rec.lead_source_code := NULL;
82   -- END IF;
83 
84 
85   -- Now copy the rest of the columns to the private record
86   -- Hint: We provide copy all columns to the private record.
87   --       Developer should delete those fields which are used by Value-Id conversion above
88     -- Hint: Developer should remove some of the following statements because of inconsistent column name between table and view.
89 /*
90     x_pvt_grp_camp_rec.GROUP_CAMPAIGN_ID := P_grp_camp_Rec.GROUP_CAMPAIGN_ID;
91     x_pvt_grp_camp_rec.GROUP_ID := P_grp_camp_Rec.GROUP_ID;
92     x_pvt_grp_camp_rec.CAMPAIGN_ID := P_grp_camp_Rec.CAMPAIGN_ID;
93     x_pvt_grp_camp_rec.START_DATE := P_grp_camp_Rec.START_DATE;
94     x_pvt_grp_camp_rec.END_DATE := P_grp_camp_Rec.END_DATE;
95     x_pvt_grp_camp_rec.ENABLED_FLAG := P_grp_camp_Rec.ENABLED_FLAG;
96     x_pvt_grp_camp_rec.LAST_UPDATE_DATE := P_grp_camp_Rec.LAST_UPDATE_DATE;
97     x_pvt_grp_camp_rec.LAST_UPDATED_BY := P_grp_camp_Rec.LAST_UPDATED_BY;
98     x_pvt_grp_camp_rec.LAST_UPDATE_LOGIN := P_grp_camp_Rec.LAST_UPDATE_LOGIN;
99     x_pvt_grp_camp_rec.CREATED_BY := P_grp_camp_Rec.CREATED_BY;
100     x_pvt_grp_camp_rec.CREATION_DATE := P_grp_camp_Rec.CREATION_DATE;
101 */
102 
103   -- If there is an error in conversion precessing, raise an error.
104     IF l_any_errors
105     THEN
106         raise FND_API.G_EXC_ERROR;
107     END IF;
108 
109 END Convert_grp_camp_Values_To_Ids;
110 PROCEDURE Create_grp_camp(
111     P_Api_Version_Number         IN   NUMBER,
112     P_Init_Msg_List              IN   VARCHAR2     := FND_API.G_FALSE,
113     P_Commit                     IN   VARCHAR2     := FND_API.G_FALSE,
114     P_grp_camp_Rec     IN    grp_camp_Rec_Type  := G_MISS_grp_camp_REC,
115   --Hint: Add detail tables as parameter lists if it's master-detail relationship.
116     X_GROUP_CAMPAIGN_ID     OUT  NUMBER,
117     X_Return_Status              OUT  VARCHAR2,
118     X_Msg_Count                  OUT  NUMBER,
119     X_Msg_Data                   OUT  VARCHAR2
120     )
121 
122  IS
123 l_api_name                CONSTANT VARCHAR2(30) := 'Create_grp_camp';
124 l_api_version_number      CONSTANT NUMBER   := 2.0;
125 l_pvt_grp_camp_rec    ast_grp_camp_PVT.grp_camp_Rec_Type;
126  BEGIN
127       -- Standard Start of API savepoint
128       SAVEPOINT CREATE_grp_camp_PUB;
129 
130       -- Standard call to check for call compatibility.
131       IF NOT FND_API.Compatible_API_Call ( l_api_version_number,
132                          	             p_api_version_number,
133                                            l_api_name,
134                                            G_PKG_NAME)
135       THEN
136           RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
137       END IF;
138 
139 
140       -- Initialize message list if p_init_msg_list is set to TRUE.
141       IF FND_API.to_Boolean( p_init_msg_list )
142       THEN
143           FND_MSG_PUB.initialize;
144       END IF;
145 
146 
147       -- Debug Message
148       JTF_PLSQL_API.Debug_Message(FND_MSG_PUB.G_MSG_LVL_DEBUG_LOW, 'ast', 'Public API: ' || l_api_name || 'start');
149 
150 
151       -- Initialize API return status to SUCCESS
152       x_return_status := FND_API.G_RET_STS_SUCCESS;
153 
154       --
155       -- API body
156       --
157 
158       -- Debug Message
159       JTF_PLSQL_API.Debug_Message(FND_MSG_PUB.G_MSG_LVL_DEBUG_LOW, 'ast', 'AS: Public API: Convert_grp_camp_Values_To_Ids');
160 
161       -- Convert the values to ids
162       --
163       Convert_grp_camp_Values_To_Ids (
164             p_grp_camp_rec       =>  p_grp_camp_rec,
165             x_pvt_grp_camp_rec   =>  l_pvt_grp_camp_rec
166       );
167 
168     -- Calling Private package: Create_grp_camp
169     -- Hint: Primary key needs to be returned
170       ast_grp_camp_PVT.Create_grp_camp(
171       P_Api_Version_Number         => 2.0,
172       P_Init_Msg_List              => FND_API.G_FALSE,
173       P_Commit                     => FND_API.G_FALSE,
174       P_Validation_Level           => FND_API.G_VALID_LEVEL_FULL,
175       P_grp_camp_Rec  =>  l_pvt_grp_camp_Rec ,
176     -- Hint: Add detail tables as parameter lists if it's master-detail relationship.
177       X_GROUP_CAMPAIGN_ID     => x_GROUP_CAMPAIGN_ID,
178       X_Return_Status              => x_return_status,
179       X_Msg_Count                  => x_msg_count,
180       X_Msg_Data                   => x_msg_data);
181 
182 
183 
184       -- Check return status from the above procedure call
185       IF x_return_status = FND_API.G_RET_STS_ERROR then
186           raise FND_API.G_EXC_ERROR;
187       elsif x_return_status = FND_API.G_RET_STS_UNEXP_ERROR then
188           raise FND_API.G_EXC_UNEXPECTED_ERROR;
189       END IF;
190 
191       --
192       -- End of API body.
193       --
194 
195       -- Standard check for p_commit
196       IF FND_API.to_Boolean( p_commit )
197       THEN
198           COMMIT WORK;
199       END IF;
200 
201 
202       -- Debug Message
203       JTF_PLSQL_API.Debug_Message(FND_MSG_PUB.G_MSG_LVL_DEBUG_LOW, 'ast', 'Public API: ' || l_api_name || 'end');
204 
205 
206       -- Standard call to get message count and if count is 1, get message info.
207       FND_MSG_PUB.Count_And_Get
208       (  p_count          =>   x_msg_count,
209          p_data           =>   x_msg_data
210       );
211 
212       EXCEPTION
213           WHEN FND_API.G_EXC_ERROR THEN
214               JTF_PLSQL_API.HANDLE_EXCEPTIONS(
215                    P_API_NAME => L_API_NAME
216                   ,P_PKG_NAME => G_PKG_NAME
217                   ,P_EXCEPTION_LEVEL => FND_MSG_PUB.G_MSG_LVL_ERROR
218                   ,P_PACKAGE_TYPE => JTF_PLSQL_API.G_PUB
219                   ,X_MSG_COUNT => X_MSG_COUNT
220                   ,X_MSG_DATA => X_MSG_DATA
221                   ,X_RETURN_STATUS => X_RETURN_STATUS);
222 
223           WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
224               JTF_PLSQL_API.HANDLE_EXCEPTIONS(
225                    P_API_NAME => L_API_NAME
226                   ,P_PKG_NAME => G_PKG_NAME
227                   ,P_EXCEPTION_LEVEL => FND_MSG_PUB.G_MSG_LVL_UNEXP_ERROR
228                   ,P_PACKAGE_TYPE => JTF_PLSQL_API.G_PUB
229                   ,X_MSG_COUNT => X_MSG_COUNT
230                   ,X_MSG_DATA => X_MSG_DATA
231                   ,X_RETURN_STATUS => X_RETURN_STATUS);
232 
233           WHEN OTHERS THEN
234               JTF_PLSQL_API.HANDLE_EXCEPTIONS(
235                    P_API_NAME => L_API_NAME
236                   ,P_PKG_NAME => G_PKG_NAME
237                   ,P_EXCEPTION_LEVEL => JTF_PLSQL_API.G_EXC_OTHERS
238                   ,P_PACKAGE_TYPE => JTF_PLSQL_API.G_PUB
239                   ,X_MSG_COUNT => X_MSG_COUNT
240                   ,X_MSG_DATA => X_MSG_DATA
241                   ,X_RETURN_STATUS => X_RETURN_STATUS);
242 End Create_grp_camp;
243 
244 
245 -- Hint: Add corresponding update detail table procedures if it's master-detail relationship.
246 PROCEDURE Update_grp_camp(
247     P_Api_Version_Number         IN   NUMBER,
248     P_Init_Msg_List              IN   VARCHAR2     := FND_API.G_FALSE,
249     P_Commit                     IN   VARCHAR2     := FND_API.G_FALSE,
250     P_Identity_Salesforce_Id     IN   NUMBER       := NULL,
251     P_grp_camp_Rec     IN    grp_camp_Rec_Type,
252     X_Return_Status              OUT  VARCHAR2,
253     X_Msg_Count                  OUT  NUMBER,
254     X_Msg_Data                   OUT  VARCHAR2
255     )
256 
257  IS
258 l_api_name                CONSTANT VARCHAR2(30) := 'Update_grp_camp';
259 l_api_version_number      CONSTANT NUMBER   := 2.0;
260 l_pvt_grp_camp_rec  ast_grp_camp_PVT.grp_camp_Rec_Type;
261  BEGIN
262       -- Standard Start of API savepoint
263       SAVEPOINT UPDATE_grp_camp_PUB;
264 
265       -- Standard call to check for call compatibility.
266       IF NOT FND_API.Compatible_API_Call ( l_api_version_number,
267                          	             p_api_version_number,
268                                            l_api_name,
269                                            G_PKG_NAME)
270       THEN
271           RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
272       END IF;
273 
274 
275       -- Initialize message list if p_init_msg_list is set to TRUE.
276       IF FND_API.to_Boolean( p_init_msg_list )
277       THEN
278           FND_MSG_PUB.initialize;
279       END IF;
280 
281 
282       -- Debug Message
283       JTF_PLSQL_API.Debug_Message(FND_MSG_PUB.G_MSG_LVL_DEBUG_LOW, 'ast', 'Public API: ' || l_api_name || 'start');
284 
285 
286       -- Initialize API return status to SUCCESS
287       x_return_status := FND_API.G_RET_STS_SUCCESS;
288 
289       --
290       -- API body
291       --
292 
293       -- Debug Message
294       JTF_PLSQL_API.Debug_Message(FND_MSG_PUB.G_MSG_LVL_DEBUG_LOW, 'ast', 'AS: Public API: Convert_grp_camp_Values_To_Ids');
295 
296       -- Convert the values to ids
297       --
298       Convert_grp_camp_Values_To_Ids (
299             p_grp_camp_rec       =>  p_grp_camp_rec,
300             x_pvt_grp_camp_rec   =>  l_pvt_grp_camp_rec
301       );
302 
303     ast_grp_camp_PVT.Update_grp_camp(
304     P_Api_Version_Number         => 2.0,
305     P_Init_Msg_List              => FND_API.G_FALSE,
306     P_Commit                     => p_commit,
307     P_Validation_Level           => FND_API.G_VALID_LEVEL_FULL,
308     P_Identity_Salesforce_Id     => p_identity_salesforce_id,
309     P_grp_camp_Rec  =>  l_pvt_grp_camp_Rec ,
310     X_Return_Status              => x_return_status,
311     X_Msg_Count                  => x_msg_count,
312     X_Msg_Data                   => x_msg_data);
313 
314 
315 
316       -- Check return status from the above procedure call
317       IF x_return_status = FND_API.G_RET_STS_ERROR then
318           raise FND_API.G_EXC_ERROR;
319       elsif x_return_status = FND_API.G_RET_STS_UNEXP_ERROR then
320           raise FND_API.G_EXC_UNEXPECTED_ERROR;
321       END IF;
322 
323       --
324       -- End of API body
325       --
326 
327       -- Standard check for p_commit
328       IF FND_API.to_Boolean( p_commit )
329       THEN
330           COMMIT WORK;
331       END IF;
332 
333 
334       -- Debug Message
335       JTF_PLSQL_API.Debug_Message(FND_MSG_PUB.G_MSG_LVL_DEBUG_LOW, 'ast', 'Public API: ' || l_api_name || 'end');
336 
337 
338       -- Standard call to get message count and if count is 1, get message info.
339       FND_MSG_PUB.Count_And_Get
340       (  p_count          =>   x_msg_count,
341          p_data           =>   x_msg_data
342       );
343 
344       EXCEPTION
345           WHEN FND_API.G_EXC_ERROR THEN
346               JTF_PLSQL_API.HANDLE_EXCEPTIONS(
347                    P_API_NAME => L_API_NAME
348                   ,P_PKG_NAME => G_PKG_NAME
349                   ,P_EXCEPTION_LEVEL => FND_MSG_PUB.G_MSG_LVL_ERROR
350                   ,P_PACKAGE_TYPE => JTF_PLSQL_API.G_PUB
351                   ,X_MSG_COUNT => X_MSG_COUNT
352                   ,X_MSG_DATA => X_MSG_DATA
353                   ,X_RETURN_STATUS => X_RETURN_STATUS);
354 
355           WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
356               JTF_PLSQL_API.HANDLE_EXCEPTIONS(
357                    P_API_NAME => L_API_NAME
358                   ,P_PKG_NAME => G_PKG_NAME
359                   ,P_EXCEPTION_LEVEL => FND_MSG_PUB.G_MSG_LVL_UNEXP_ERROR
360                   ,P_PACKAGE_TYPE => JTF_PLSQL_API.G_PUB
361                   ,X_MSG_COUNT => X_MSG_COUNT
362                   ,X_MSG_DATA => X_MSG_DATA
363                   ,X_RETURN_STATUS => X_RETURN_STATUS);
364 
365           WHEN OTHERS THEN
366               JTF_PLSQL_API.HANDLE_EXCEPTIONS(
367                    P_API_NAME => L_API_NAME
368                   ,P_PKG_NAME => G_PKG_NAME
369                   ,P_EXCEPTION_LEVEL => JTF_PLSQL_API.G_EXC_OTHERS
370                   ,P_PACKAGE_TYPE => JTF_PLSQL_API.G_PUB
371                   ,X_MSG_COUNT => X_MSG_COUNT
372                   ,X_MSG_DATA => X_MSG_DATA
373                   ,X_RETURN_STATUS => X_RETURN_STATUS);
374 End Update_grp_camp;
375 
376 
377 -- Hint: Add corresponding delete detail table procedures if it's master-detail relationship.
378 --       The Master delete procedure may not be needed depends on different business requirements.
382     P_Commit                     IN   VARCHAR2     := FND_API.G_FALSE,
379 PROCEDURE Delete_grp_camp(
380     P_Api_Version_Number         IN   NUMBER,
381     P_Init_Msg_List              IN   VARCHAR2     := FND_API.G_FALSE,
383     P_identity_salesforce_id     IN   NUMBER       := NULL,
384     P_grp_camp_Rec     IN grp_camp_Rec_Type,
385     X_Return_Status              OUT  VARCHAR2,
386     X_Msg_Count                  OUT  NUMBER,
387     X_Msg_Data                   OUT  VARCHAR2
388     )
389 
390  IS
391 l_api_name                CONSTANT VARCHAR2(30) := 'Delete_grp_camp';
392 l_api_version_number      CONSTANT NUMBER   := 2.0;
393 l_pvt_grp_camp_rec  ast_grp_camp_PVT.grp_camp_Rec_Type;
394  BEGIN
395       -- Standard Start of API savepoint
396       SAVEPOINT DELETE_grp_camp_PUB;
397 
398       -- Standard call to check for call compatibility.
399       IF NOT FND_API.Compatible_API_Call ( l_api_version_number,
400                          	             p_api_version_number,
401                                            l_api_name,
402                                            G_PKG_NAME)
403       THEN
404           RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
405       END IF;
406 
407 
408       -- Initialize message list if p_init_msg_list is set to TRUE.
409       IF FND_API.to_Boolean( p_init_msg_list )
410       THEN
411           FND_MSG_PUB.initialize;
412       END IF;
413 
414 
415       -- Debug Message
416       JTF_PLSQL_API.Debug_Message(FND_MSG_PUB.G_MSG_LVL_DEBUG_LOW, 'ast', 'Public API: ' || l_api_name || 'start');
417 
418 
419       -- Initialize API return status to SUCCESS
420       x_return_status := FND_API.G_RET_STS_SUCCESS;
421 
422       --
423       -- API body
424       --
425 
426       -- Debug Message
427       JTF_PLSQL_API.Debug_Message(FND_MSG_PUB.G_MSG_LVL_DEBUG_LOW, 'ast', 'AS: Public API: Convert_grp_camp_Values_To_Ids');
428 
429       -- Convert the values to ids
430       --
431       Convert_grp_camp_Values_To_Ids (
432             p_grp_camp_rec       =>  p_grp_camp_rec,
433             x_pvt_grp_camp_rec   =>  l_pvt_grp_camp_rec
434       );
435 
436     ast_grp_camp_PVT.Delete_grp_camp(
437     P_Api_Version_Number         => 2.0,
438     P_Init_Msg_List              => FND_API.G_FALSE,
439     P_Commit                     => p_commit,
440     P_Validation_Level           => FND_API.G_VALID_LEVEL_FULL,
441     P_Identity_Salesforce_Id      => p_identity_salesforce_id,
442     P_grp_camp_Rec  => l_pvt_grp_camp_Rec,
443     X_Return_Status              => x_return_status,
444     X_Msg_Count                  => x_msg_count,
445     X_Msg_Data                   => x_msg_data);
446 
447 
448 
449       -- Check return status from the above procedure call
450       IF x_return_status = FND_API.G_RET_STS_ERROR then
451           raise FND_API.G_EXC_ERROR;
452       elsif x_return_status = FND_API.G_RET_STS_UNEXP_ERROR then
453           raise FND_API.G_EXC_UNEXPECTED_ERROR;
454       END IF;
455 
456       --
457       -- End of API body
458       --
459 
460       -- Standard check for p_commit
461       IF FND_API.to_Boolean( p_commit )
462       THEN
463           COMMIT WORK;
464       END IF;
465 
466 
467       -- Debug Message
468       JTF_PLSQL_API.Debug_Message(FND_MSG_PUB.G_MSG_LVL_DEBUG_LOW, 'ast', 'Public API: ' || l_api_name || 'end');
469 
470 
471       -- Standard call to get message count and if count is 1, get message info.
472       FND_MSG_PUB.Count_And_Get
473       (  p_count          =>   x_msg_count,
474          p_data           =>   x_msg_data
475       );
476 
477       EXCEPTION
478           WHEN FND_API.G_EXC_ERROR THEN
479               JTF_PLSQL_API.HANDLE_EXCEPTIONS(
480                    P_API_NAME => L_API_NAME
481                   ,P_PKG_NAME => G_PKG_NAME
482                   ,P_EXCEPTION_LEVEL => FND_MSG_PUB.G_MSG_LVL_ERROR
483                   ,P_PACKAGE_TYPE => JTF_PLSQL_API.G_PUB
484                   ,X_MSG_COUNT => X_MSG_COUNT
485                   ,X_MSG_DATA => X_MSG_DATA
486                   ,X_RETURN_STATUS => X_RETURN_STATUS);
487 
488           WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
489               JTF_PLSQL_API.HANDLE_EXCEPTIONS(
490                    P_API_NAME => L_API_NAME
491                   ,P_PKG_NAME => G_PKG_NAME
492                   ,P_EXCEPTION_LEVEL => FND_MSG_PUB.G_MSG_LVL_UNEXP_ERROR
493                   ,P_PACKAGE_TYPE => JTF_PLSQL_API.G_PUB
494                   ,X_MSG_COUNT => X_MSG_COUNT
495                   ,X_MSG_DATA => X_MSG_DATA
496                   ,X_RETURN_STATUS => X_RETURN_STATUS);
497 
498           WHEN OTHERS THEN
499               JTF_PLSQL_API.HANDLE_EXCEPTIONS(
500                    P_API_NAME => L_API_NAME
501                   ,P_PKG_NAME => G_PKG_NAME
502                   ,P_EXCEPTION_LEVEL => JTF_PLSQL_API.G_EXC_OTHERS
503                   ,P_PACKAGE_TYPE => JTF_PLSQL_API.G_PUB
504                   ,X_MSG_COUNT => X_MSG_COUNT
505                   ,X_MSG_DATA => X_MSG_DATA
506                   ,X_RETURN_STATUS => X_RETURN_STATUS);
507 End Delete_grp_camp;
508 
509 
510 PROCEDURE Get_grp_camp(
511     P_Api_Version_Number         IN   NUMBER,
512     P_Init_Msg_List              IN   VARCHAR2     := FND_API.G_FALSE,
516     p_rec_requested              IN   NUMBER  := G_DEFAULT_NUM_REC_FETCH,
513     P_identity_salesforce_id     IN   NUMBER       := NULL,
514     P_grp_camp_Rec     IN    ast_grp_camp_PUB.grp_camp_Rec_Type,
515   -- Hint: Add list of bind variables here
517     p_start_rec_prt              IN   NUMBER  := 1,
518     p_return_tot_count           IN   NUMBER  := FND_API.G_FALSE,
519   -- Hint: user defined record type
520     p_order_by_rec               IN   ast_grp_camp_PUB.grp_camp_sort_rec_type,
521     x_return_status              OUT  VARCHAR2,
522     x_msg_count                  OUT  NUMBER,
523     x_msg_data                   OUT  VARCHAR2,
524     X_grp_camp_Tbl  OUT  ast_grp_camp_PUB.grp_camp_Tbl_Type,
525     x_returned_rec_count         OUT  NUMBER,
526     x_next_rec_ptr               OUT  NUMBER,
527     x_tot_rec_count              OUT  NUMBER
528   -- other optional parameters
529 --  x_tot_rec_amount             OUT  NUMBER
530     )
531 
532  IS
533 l_api_name                CONSTANT VARCHAR2(30) := 'Get_grp_camp';
534 l_api_version_number      CONSTANT NUMBER   := 2.0;
535  BEGIN
536       -- Standard Start of API savepoint
537       SAVEPOINT GET_grp_camp_PUB;
538 
539       -- Standard call to check for call compatibility.
540       IF NOT FND_API.Compatible_API_Call ( l_api_version_number,
541                          	             p_api_version_number,
542                                            l_api_name,
543                                            G_PKG_NAME)
544       THEN
545           RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
546       END IF;
547 
548 
549       -- Initialize message list if p_init_msg_list is set to TRUE.
550       IF FND_API.to_Boolean( p_init_msg_list )
551       THEN
552           FND_MSG_PUB.initialize;
553       END IF;
554 
555 
556       -- Debug Message
557       JTF_PLSQL_API.Debug_Message(FND_MSG_PUB.G_MSG_LVL_DEBUG_LOW, 'ast', 'Public API: ' || l_api_name || 'start');
558 
559 
560       -- Initialize API return status to SUCCESS
561       x_return_status := FND_API.G_RET_STS_SUCCESS;
562 
563       --
564       -- API body
565       --
566       -- Debug Message
567       JTF_PLSQL_API.Debug_Message(FND_MSG_PUB.G_MSG_LVL_DEBUG_LOW, 'ast', 'Public API: - Calling PVT.Get_grp_camp');
568     ast_grp_camp_PVT.Get_grp_camp(
569     P_Api_Version_Number         => 2.0,
570     P_Init_Msg_List              => FND_API.G_FALSE,
571     p_validation_level           => FND_API.G_VALID_LEVEL_FULL,
572     P_Identity_Salesforce_id     => p_identity_salesforce_id,
576     p_return_tot_count           => p_return_tot_count,
573     P_grp_camp_Rec  =>  P_grp_camp_Rec,
574     p_rec_requested              => p_rec_requested,
575     p_start_rec_prt              => p_start_rec_prt,
577   -- Hint: user defined record type
578     p_order_by_rec               => p_order_by_rec,
579     X_Return_Status              => x_return_status,
580     X_Msg_Count                  => x_msg_count,
581     X_Msg_Data                   => x_msg_data,
582     X_grp_camp_Tbl  => X_grp_camp_Tbl,
583     x_returned_rec_count         => x_returned_rec_count,
584     x_next_rec_ptr               => x_next_rec_ptr,
585     x_tot_rec_count              => x_tot_rec_count
586     -- other optional parameters
587     -- x_tot_rec_amount             => x_tot_rec_amount
588     );
589 
590 
591 
592       -- Check return status from the above procedure call
593       IF x_return_status = FND_API.G_RET_STS_ERROR then
594           raise FND_API.G_EXC_ERROR;
595       elsif x_return_status = FND_API.G_RET_STS_UNEXP_ERROR then
596           raise FND_API.G_EXC_UNEXPECTED_ERROR;
597       END IF;
598 
599       --
600       -- End of API body
601       --
602 
603       -- Debug Message
604       JTF_PLSQL_API.Debug_Message(FND_MSG_PUB.G_MSG_LVL_DEBUG_LOW, 'ast', 'Public API: ' || l_api_name || 'end');
605 
606 
607       -- Standard call to get message count and if count is 1, get message info.
608       FND_MSG_PUB.Count_And_Get
609       (  p_count          =>   x_msg_count,
610          p_data           =>   x_msg_data
611       );
612 
613       EXCEPTION
614           WHEN FND_API.G_EXC_ERROR THEN
615               JTF_PLSQL_API.HANDLE_EXCEPTIONS(
616                    P_API_NAME => L_API_NAME
617                   ,P_PKG_NAME => G_PKG_NAME
618                   ,P_EXCEPTION_LEVEL => FND_MSG_PUB.G_MSG_LVL_ERROR
619                   ,P_PACKAGE_TYPE => JTF_PLSQL_API.G_PUB
620                   ,X_MSG_COUNT => X_MSG_COUNT
621                   ,X_MSG_DATA => X_MSG_DATA
622                   ,X_RETURN_STATUS => X_RETURN_STATUS);
623 
624           WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
625               JTF_PLSQL_API.HANDLE_EXCEPTIONS(
626                    P_API_NAME => L_API_NAME
627                   ,P_PKG_NAME => G_PKG_NAME
628                   ,P_EXCEPTION_LEVEL => FND_MSG_PUB.G_MSG_LVL_UNEXP_ERROR
629                   ,P_PACKAGE_TYPE => JTF_PLSQL_API.G_PUB
630                   ,X_MSG_COUNT => X_MSG_COUNT
631                   ,X_MSG_DATA => X_MSG_DATA
632                   ,X_RETURN_STATUS => X_RETURN_STATUS);
633 
634           WHEN OTHERS THEN
635               JTF_PLSQL_API.HANDLE_EXCEPTIONS(
636                    P_API_NAME => L_API_NAME
637                   ,P_PKG_NAME => G_PKG_NAME
638                   ,P_EXCEPTION_LEVEL => JTF_PLSQL_API.G_EXC_OTHERS
639                   ,P_PACKAGE_TYPE => JTF_PLSQL_API.G_PUB
640                   ,X_MSG_COUNT => X_MSG_COUNT
641                   ,X_MSG_DATA => X_MSG_DATA
642                   ,X_RETURN_STATUS => X_RETURN_STATUS);
643 End Get_grp_camp;
644 
645 
646 End ast_grp_camp_PUB;