[Home] [Help]
PACKAGE BODY: APPS.EAM_ASSET_OPERATION_TXN_PUB
Source
1 PACKAGE BODY EAM_ASSET_OPERATION_TXN_PUB AS
2 /* $Header: EAMPACHB.pls 120.1 2005/07/04 09:53:43 ksiddhar noship $ */
3 /*
4 --Start of comments
5 -- API name : EAM_ASSET_OPERATION_TXN_PUB
6 -- Type : Public
7 -- Function : Insert and validation of the checkin/checkout transaction data
8 -- Pre-reqs : None.
9 */
10
11 /* This procedure inserts a record in the eam_asset_operation_txn table after validation
12
13 -- Parameters :
14 -- IN :
15 -- p_txn_date date on which the transaction is being performed
16 -- p_txn_type transaction type which can either be checkin or checkout
17 -- p_instance_id Asset Number identification number
18 -- p_comments comments entered by the user during the transaction
19 -- p_qa_collection_id quality collection id to identify the results entered during the transaction
20 -- p_operable_flag operable status of the asset(1 or 2)
21 -- p_employee_id employee who actually is performing the transaction
22 -- p_eam_ops_quality_tbl plsql table of quality collection results entered during the transaction
23 -- p_meter_reading_rec_tbl plsql table of meter reading entries made during the transaction
24 -- p_counter_properties_tbl plsql table of counter properties entered during the transaction
25 --
26 --
27 -- out : x_return_status return status
28 -- x_msg_count count of error messages
29 -- x_msg_data error message data
30 -- Version : Current version: 1.0
31 -- Initial version: 1.0
32 --
33 -- Notes
34 --
35 -- End of comments
36
37 */
38
39
40
41
42
43 PROCEDURE process_checkinout_txn
44 (
45 p_api_version IN number :=1.0,
46 p_init_msg_list IN varchar2 :=fnd_api.g_false,
47 p_commit IN varchar2 :=fnd_api.g_false,
48 p_validation_level IN number :=fnd_api.g_valid_level_full,
49 p_txn_date IN date :=sysdate,
50 p_txn_type IN number,
51 p_instance_id IN number,
52 p_comments IN varchar2 := NULL,
53 p_qa_collection_id IN number := NULL,
54 p_operable_flag IN number,
55 p_employee_id IN number,
56 p_eam_ops_quality_tbl IN eam_asset_operation_txn_pub.eam_quality_tbl_type,
57 p_meter_reading_rec_tbl IN eam_asset_operation_txn_pub.meter_reading_rec_tbl_type,
58 p_counter_properties_tbl IN eam_asset_operation_txn_pub.Ctr_Property_readings_Tbl,
59 p_attribute_category IN varchar2 := NULL,
60 p_attribute1 IN varchar2 := NULL,
61 p_attribute2 IN varchar2 := NULL,
62 p_attribute3 IN varchar2 := NULL,
63 p_attribute4 IN varchar2 := NULL,
64 p_attribute5 IN varchar2 := NULL,
65 p_attribute6 IN varchar2 := NULL,
66 p_attribute7 IN varchar2 := NULL,
67 p_attribute8 IN varchar2 := NULL,
68 p_attribute9 IN varchar2 := NULL,
69 p_attribute10 IN varchar2 := NULL,
70 p_attribute11 IN varchar2 := NULL,
71 p_attribute12 IN varchar2 := NULL,
72 p_attribute13 IN varchar2 := NULL,
73 p_attribute14 IN varchar2 := NULL,
74 p_attribute15 IN varchar2 := NULL,
75 x_return_status OUT NOCOPY varchar2,
76 x_msg_count OUT NOCOPY number,
77 x_msg_data OUT NOCOPY varchar2
78 )
79 IS
80
81
82 l_api_name constant varchar2(30) :='EAM_ASSET_OPERATION_TXN_PUB';
83 l_api_version constant number := 1.0;
84 g_pkg_name constant varchar2(30) :='EAM_ASSET_OPERATION_TXN_PUB';
85
86
87
88 BEGIN
89
90
91 /* Standard Start of API savepoint */
92
93 SAVEPOINT EAM_ASSET_OPERATION_TXN_PUB;
94
95 /* Standard call to check for call compatibility. */
96 IF NOT
97 FND_API.Compatible_API_Call(
98 l_api_version,
99 p_api_version,
100 l_api_name,
101 g_pkg_name
102 )
103
104 THEN
105 RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
106 END IF;
107
108 /* Initialize message list if p_init_msg_list is set to TRUE. */
109 IF FND_API.to_Boolean( p_init_msg_list )
110 THEN
111 FND_MSG_PUB.initialize;
112 END IF;
113
114 /* Initialize API return status to success */
115 x_return_status := FND_API.G_RET_STS_SUCCESS;
116
117 /* API body */
118
119
120 --Call insert_txn of private api
121
122
123
124
125 EAM_ASSET_OPERATION_TXN_PVT.insert_txn(
126 p_txn_date => p_txn_date,
127 p_txn_type => p_txn_type,
128 p_instance_id => p_instance_id,
129 p_comments => p_comments,
130 p_qa_collection_id => p_qa_collection_id,
131 p_operable_flag => p_operable_flag,
132 p_employee_id => p_employee_id,
133 p_eam_ops_quality_tbl => p_eam_ops_quality_tbl,
134 p_meter_reading_rec_tbl => p_meter_reading_rec_tbl,
135 p_counter_properties_tbl => p_counter_properties_tbl,
136 p_attribute_category => p_attribute_category,
137 p_attribute1 => p_attribute1,
138 p_attribute2 => p_attribute2,
139 p_attribute3 => p_attribute3,
140 p_attribute4 => p_attribute4,
141 p_attribute5 => p_attribute5,
142 p_attribute6 => p_attribute6,
143 p_attribute7 => p_attribute7,
144 p_attribute8 => p_attribute8,
145 p_attribute9 => p_attribute9,
146 p_attribute10 => p_attribute10,
147 p_attribute11 => p_attribute11,
148 p_attribute12 => p_attribute12,
149 p_attribute13 => p_attribute13,
150 p_attribute14 => p_attribute14,
151 p_attribute15 => p_attribute15,
152 x_return_status => x_return_status,
153 x_msg_count => x_msg_count,
154 x_msg_data => x_msg_data
155 );
156
157
158 IF x_return_status <> fnd_api.g_ret_sts_success THEN
159 ROLLBACK TO EAM_ASSET_OPERATION_TXN_PUB;
160 RETURN;
161 END IF;
162 /* Standard check of p_commit. */
163
164 IF FND_API.TO_BOOLEAN( P_COMMIT ) THEN
165 COMMIT WORK;
166 END IF;
167
168 -- Standard call to get message count and if count is 1, get message info.
169
170 FND_MSG_PUB.GET
171 ( p_msg_index_out => x_msg_count ,
172 p_data => x_msg_data
173 );
174
175 EXCEPTION
176
177 WHEN FND_API.G_EXC_ERROR THEN
178 ROLLBACK TO EAM_ASSET_OPERATION_TXN_PUB;
179 x_return_status := FND_API.G_RET_STS_ERROR ;
180
181 FND_MSG_PUB.Get
182 ( p_msg_index_out => x_msg_count ,
183 p_data => x_msg_data
184 );
185
186 WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
187 ROLLBACK TO EAM_ASSET_OPERATION_TXN_PUB;
188 x_return_status := FND_API.G_RET_STS_UNEXP_ERROR ;
189 FND_MSG_PUB.get
190 ( p_msg_index_out => x_msg_count ,
191 p_data => x_msg_data
192 );
193
194 WHEN OTHERS THEN
195 ROLLBACK TO EAM_ASSET_OPERATION_TXN_PUB;
196 x_return_status := FND_API.G_RET_STS_UNEXP_ERROR ;
197
198 IF FND_MSG_PUB.Check_Msg_Level
199 (FND_MSG_PUB.G_MSG_LVL_UNEXP_ERROR)
200 THEN
201 FND_MSG_PUB.Add_Exc_Msg
202 (
203 l_api_name,
204 g_pkg_name
205 );
206 END IF;
207
208 FND_MSG_PUB.get
209 ( p_msg_index_out => x_msg_count ,
210 p_data => x_msg_data
211 );
212
213 END process_checkinout_txn;
214
215
216 PROCEDURE print_log(info varchar2) is
217
218 PRAGMA AUTONOMOUS_TRANSACTION;
219 l_dummy number;
220 BEGIN
221 /*
222 if (g_sr_no is null or g_sr_no<0) then
223 g_sr_no := 0;
224 end if;
225
226 g_sr_no := g_sr_no+1;
227
228 INSERT into temp_isetup_api(msg,sr_no)
229 VALUES (info,g_sr_no);
230
231 commit;
232 */
233 FND_FILE.PUT_LINE(FND_FILE.LOG, info);
234
235 END print_log;
236
237 END EAM_ASSET_OPERATION_TXN_PUB;