1 Package Body Pa_Plan_RL_Formats_Pub as
2 /* $Header: PARRFTPB.pls 120.0 2005/06/03 14:16:24 appldev noship $ */
3
4 /************************************************************
5 * Procedure : Create_Plan_RL_Format
6 * Description : This procedure is used the pass a Table of
7 * Record, and call the
8 * Pa_Plan_RL_Formats_Pvt.Create_Plan_RL_Format
9 * procedure, which would create the res formats.
10 *************************************************************/
11 Procedure Create_Plan_RL_Format(
12 p_commit IN VARCHAR2 DEFAULT FND_API.G_FALSE,
13 p_init_msg_list IN VARCHAR2 DEFAULT FND_API.G_FALSE,
14 P_Res_List_Id IN Number,
15 P_Plan_RL_Format_Tbl IN Plan_RL_Format_In_Tbl,
16 X_Plan_RL_Format_Tbl OUT NOCOPY Plan_RL_Format_Out_Tbl,
17 X_Return_Status OUT NOCOPY Varchar2,
18 X_Msg_Count OUT NOCOPY Number,
19 X_Msg_Data OUT NOCOPY Varchar2)
20 IS
21 BEGIN
22 -- First clear the message stack.
23 IF FND_API.to_boolean( p_init_msg_list )
24 THEN
25 FND_MSG_PUB.initialize;
26 END IF;
27
28 x_msg_count := 0;
29 x_return_status := FND_API.G_RET_STS_SUCCESS;
30
31 /***************************************************************
32 * For Loop. To loop through the table of records and
33 * Validate each one of them and insert accordingly.
34 ***************************************************************/
35 FOR i IN 1..P_Plan_RL_Format_Tbl.COUNT
36 LOOP
37 Pa_Plan_RL_Formats_Pvt.Create_Plan_RL_Format(
38 P_Res_List_Id =>P_Res_List_Id,
39 P_Res_Format_Id =>P_Plan_RL_Format_Tbl(i).P_Res_Format_Id,
40 X_Plan_RL_Format_Id =>X_Plan_RL_Format_Tbl(i).X_Plan_RL_Format_Id,
41 X_Record_Version_Number =>
42 X_Plan_RL_Format_Tbl(i).X_Record_Version_Number,
43 X_Return_Status =>X_Return_Status,
44 X_Msg_Count =>X_Msg_Count,
45 X_Msg_Data =>X_Msg_Data);
46 END LOOP;
47 /************************************************
48 * Check the Commit flag. if it is true then Commit.
49 ***********************************************/
50 IF FND_API.to_boolean( p_commit )
51 THEN
52 COMMIT;
53 END IF;
54
55
56 END Create_Plan_RL_Format;
57 /************************************************************
58 * Procedure : Create_Plan_RL_Format
59 * Description : This procedure is used the pass a Table of
60 * elements, and call the
61 * Pa_Plan_RL_Formats_Pvt.Create_Plan_RL_Format
62 * procedure, which would create the res formats.
63 *************************************************************/
64 Procedure Create_Plan_RL_Format(
65 p_commit IN VARCHAR2 DEFAULT FND_API.G_FALSE,
66 p_init_msg_list IN VARCHAR2 DEFAULT FND_API.G_FALSE,
67 P_Res_List_Id IN Number,
68 P_Res_Format_Id IN SYSTEM.PA_NUM_TBL_TYPE,
69 X_Plan_RL_Format_Id OUT NOCOPY SYSTEM.PA_NUM_TBL_TYPE,
70 X_Record_Version_Number OUT NOCOPY SYSTEM.PA_NUM_TBL_TYPE,
71 X_Return_Status OUT NOCOPY Varchar2,
72 X_Msg_Count OUT NOCOPY Number,
73 X_Msg_Data OUT NOCOPY Varchar2)
74
75 Is
76 BEGIN
77 -- First clear the message stack.
78 IF FND_API.to_boolean( p_init_msg_list )
79 THEN
80 FND_MSG_PUB.initialize;
81 END IF;
82
83 X_Plan_RL_Format_Id := SYSTEM.PA_NUM_TBL_TYPE();
84 X_Record_Version_Number := SYSTEM.PA_NUM_TBL_TYPE();
85 X_Plan_RL_Format_Id.extend(P_Res_Format_Id.count) ;
86 X_Record_Version_Number.extend(P_Res_Format_Id.count) ;
87
88 x_msg_count := 0;
89 x_return_status := FND_API.G_RET_STS_SUCCESS;
90 /***************************************************************
91 * For Loop. To loop through the table of records and
92 * Validate each one of them and insert accordingly.
93 ***************************************************************/
94
95 FOR i IN P_Res_Format_Id.first..P_Res_Format_Id.last
96 LOOP
97 Pa_Plan_RL_Formats_Pvt.Create_Plan_RL_Format(
98 P_Res_List_Id =>P_Res_List_Id,
99 P_Res_Format_Id =>P_Res_Format_Id(i),
100 X_Plan_RL_Format_Id =>X_Plan_RL_Format_Id(i),
101 X_Record_Version_Number =>X_Record_Version_Number(i),
102 X_Return_Status =>X_Return_Status,
103 X_Msg_Count =>X_Msg_Count,
104 X_Msg_Data =>X_Msg_Data);
105 END LOOP;
106 /************************************************
107 * Check the Commit flag. if it is true then Commit.
108 ***********************************************/
109 IF FND_API.to_boolean( p_commit )
110 THEN
111 COMMIT;
112 END IF;
113
114 End Create_Plan_RL_Format;
115 /********************************/
116
117 /************************************************************
118 * Procedure : Delete_Plan_RL_Format
119 * Description : This procedure is used the pass a Table of
120 * Record, and call the
121 * Pa_Plan_RL_Formats_Pvt.Delete_Plan_RL_Format
122 * procedure, which would Delete the res formats.
123 *************************************************************/
124 Procedure Delete_Plan_RL_Format (
125 p_commit IN VARCHAR2 DEFAULT FND_API.G_FALSE,
126 p_init_msg_list IN VARCHAR2 DEFAULT FND_API.G_FALSE,
127 P_Res_List_Id IN NUMBER DEFAULT Null,
128 P_Plan_RL_Format_Tbl IN Plan_RL_Format_In_Tbl ,
129 X_Return_Status OUT NOCOPY VARCHAR2,
130 X_Msg_Count OUT NOCOPY NUMBER,
131 X_Msg_Data OUT NOCOPY VARCHAR2)
132 IS
133 BEGIN
134 -- First clear the message stack.
135 IF FND_API.to_boolean( p_init_msg_list )
136 THEN
137 FND_MSG_PUB.initialize;
138 END IF;
139 /***************************************************************
140 * For Loop. To loop through the table of records and
141 * Validate each one of them and Update accordingly.
142 ***************************************************************/
143 FOR i IN 1..P_Plan_RL_Format_Tbl.COUNT
144 LOOP
145 Pa_Plan_RL_Formats_pvt.Delete_Plan_RL_Format (
146 P_Res_List_Id =>P_Res_List_Id,
147 P_Res_Format_Id =>P_Plan_RL_Format_Tbl(i).P_Res_Format_Id,
148 P_Plan_RL_Format_Id =>P_Plan_RL_Format_Tbl(i).P_Plan_RL_Format_Id,
149 X_Return_Status =>X_Return_Status,
150 X_Msg_Count =>X_Msg_Count,
151 X_Msg_Data =>X_Msg_Data);
152 END LOOP;
153
154 /************************************************
155 * Check the Commit flag. if it is true then Commit.
156 ***********************************************/
157 IF FND_API.to_boolean( p_commit )
158 THEN
159 COMMIT;
160 END IF;
161 END Delete_Plan_RL_Format;
162 /************************************************************
163 * Procedure : Delete_Plan_RL_Format
164 * Description : This procedure is used the pass a Table of
165 * elements, and call the
166 * Pa_Plan_RL_Formats_Pvt.Delete_Plan_RL_Format
167 * procedure, which would Delete the res formats.
168 *************************************************************/
169 Procedure Delete_Plan_RL_Format (
170 p_commit IN VARCHAR2 DEFAULT FND_API.G_FALSE,
171 p_init_msg_list IN VARCHAR2 DEFAULT FND_API.G_FALSE,
172 P_Res_List_Id IN Number Default Null,
173 P_Res_Format_Id IN SYSTEM.PA_NUM_TBL_TYPE Default Null,
174 P_Plan_RL_Format_Id IN SYSTEM.PA_NUM_TBL_TYPE Default Null,
175 X_Return_Status OUT NOCOPY Varchar2,
176 X_Msg_Count OUT NOCOPY Number,
177 X_Msg_Data OUT NOCOPY Varchar2)
178
179 Is
180 Begin
181 -- First clear the message stack.
182 IF FND_API.to_boolean( p_init_msg_list )
183 THEN
184 FND_MSG_PUB.initialize;
185 END IF;
186 /***************************************************************
187 * For Loop. To loop through the table of records and
188 * Validate each one of them and Update accordingly.
189 ***************************************************************/
190 FOR i IN P_Res_Format_Id.first..P_Res_Format_Id.last
191 LOOP
192 Pa_Plan_RL_Formats_pvt.Delete_Plan_RL_Format (
193 P_Res_List_Id =>P_Res_List_Id,
194 P_Res_Format_Id =>P_Res_Format_Id(i),
195 P_Plan_RL_Format_Id =>P_Plan_RL_Format_Id(i),
196 X_Return_Status =>X_Return_Status,
197 X_Msg_Count =>X_Msg_Count,
198 X_Msg_Data =>X_Msg_Data);
199 END LOOP;
200 /************************************************
201 * Check the Commit flag. if it is true then Commit.
202 ***********************************************/
203 IF FND_API.to_boolean( p_commit )
204 THEN
205 COMMIT;
206 END IF;
207
208 End Delete_Plan_RL_Format;
209
210 END Pa_Plan_RL_Formats_Pub ;