51: FETCH C INTO Recinfo;
52: IF (C%NOTFOUND) THEN
53: CLOSE C;
54: x_return_status := fnd_api.g_ret_sts_error;
55: FND_MESSAGE.Set_Name('FND', 'FORM_RECORD_DELETED');
56: fnd_msg_pub.count_and_get(p_encoded => fnd_api.g_false,
57: p_count => x_msg_count,
58: p_data => x_msg_data);
59: END IF;
94: RETURN;
95: ELSE
96: arp_util.debug(' Line Record Changed');
97: x_return_status := fnd_api.g_ret_sts_error;
98: FND_MESSAGE.SET_NAME('FND', 'FORM_RECORD_CHANGED');
99: fnd_msg_pub.count_and_get(p_encoded => fnd_api.g_false,
100: p_count => x_msg_count,
101: p_data => x_msg_data);
102: END IF;
119: arp_util.debug(' p_action :'||p_action);
120: OPEN c;
121: FETCH c INTO l_header_status;
122: IF c%NOTFOUND THEN
123: FND_MESSAGE.SET_NAME( 'AR', 'HZ_API_INVALID_FK' );
124: FND_MESSAGE.SET_TOKEN( 'FK', 'interest_header_id' );
125: FND_MESSAGE.SET_TOKEN( 'COLUMN', p_old_rec.interest_header_id);
126: FND_MESSAGE.SET_TOKEN( 'TABLE', 'ar_interest_headers' );
127: FND_MSG_PUB.ADD;
120: OPEN c;
121: FETCH c INTO l_header_status;
122: IF c%NOTFOUND THEN
123: FND_MESSAGE.SET_NAME( 'AR', 'HZ_API_INVALID_FK' );
124: FND_MESSAGE.SET_TOKEN( 'FK', 'interest_header_id' );
125: FND_MESSAGE.SET_TOKEN( 'COLUMN', p_old_rec.interest_header_id);
126: FND_MESSAGE.SET_TOKEN( 'TABLE', 'ar_interest_headers' );
127: FND_MSG_PUB.ADD;
128: x_return_status := FND_API.G_RET_STS_ERROR;
121: FETCH c INTO l_header_status;
122: IF c%NOTFOUND THEN
123: FND_MESSAGE.SET_NAME( 'AR', 'HZ_API_INVALID_FK' );
124: FND_MESSAGE.SET_TOKEN( 'FK', 'interest_header_id' );
125: FND_MESSAGE.SET_TOKEN( 'COLUMN', p_old_rec.interest_header_id);
126: FND_MESSAGE.SET_TOKEN( 'TABLE', 'ar_interest_headers' );
127: FND_MSG_PUB.ADD;
128: x_return_status := FND_API.G_RET_STS_ERROR;
129: END IF;
122: IF c%NOTFOUND THEN
123: FND_MESSAGE.SET_NAME( 'AR', 'HZ_API_INVALID_FK' );
124: FND_MESSAGE.SET_TOKEN( 'FK', 'interest_header_id' );
125: FND_MESSAGE.SET_TOKEN( 'COLUMN', p_old_rec.interest_header_id);
126: FND_MESSAGE.SET_TOKEN( 'TABLE', 'ar_interest_headers' );
127: FND_MSG_PUB.ADD;
128: x_return_status := FND_API.G_RET_STS_ERROR;
129: END IF;
130: CLOSE c;
132: IF p_action = 'UPDATE' THEN
133: IF l_header_status = 'S' THEN
134: IF p_old_rec.process_status <> p_new_rec.process_status THEN
135: arp_util.debug('Column process_status not updatable');
136: FND_MESSAGE.SET_NAME( 'AR', 'HZ_API_NONUPDATEABLE_COLUMN' );
137: FND_MESSAGE.SET_TOKEN( 'COLUMN', 'batch_status');
138: FND_MSG_PUB.ADD;
139: x_return_status := FND_API.G_RET_STS_ERROR;
140: END IF;
133: IF l_header_status = 'S' THEN
134: IF p_old_rec.process_status <> p_new_rec.process_status THEN
135: arp_util.debug('Column process_status not updatable');
136: FND_MESSAGE.SET_NAME( 'AR', 'HZ_API_NONUPDATEABLE_COLUMN' );
137: FND_MESSAGE.SET_TOKEN( 'COLUMN', 'batch_status');
138: FND_MSG_PUB.ADD;
139: x_return_status := FND_API.G_RET_STS_ERROR;
140: END IF;
141: END IF;
145: IF p_action = 'DELETE' THEN
146: IF l_header_status = 'S' THEN
147: IF p_old_rec.process_status <> p_new_rec.process_status THEN
148: arp_util.debug('Column process_status not updatable');
149: FND_MESSAGE.SET_NAME( 'AR', 'HZ_API_NONUPDATEABLE_COLUMN' );
150: FND_MESSAGE.SET_TOKEN( 'COLUMN', 'batch_status');
151: FND_MSG_PUB.ADD;
152: x_return_status := FND_API.G_RET_STS_ERROR;
153: END IF;
146: IF l_header_status = 'S' THEN
147: IF p_old_rec.process_status <> p_new_rec.process_status THEN
148: arp_util.debug('Column process_status not updatable');
149: FND_MESSAGE.SET_NAME( 'AR', 'HZ_API_NONUPDATEABLE_COLUMN' );
150: FND_MESSAGE.SET_TOKEN( 'COLUMN', 'batch_status');
151: FND_MSG_PUB.ADD;
152: x_return_status := FND_API.G_RET_STS_ERROR;
153: END IF;
154: END IF;
190: FETCH c INTO l_rec;
191: CLOSE c;
192:
193: IF l_rec.INTEREST_line_ID IS NULL THEN
194: fnd_message.set_name('AR', 'HZ_API_NO_RECORD');
195: fnd_message.set_token('RECORD', 'ar_interest_lines');
196: fnd_message.set_token('VALUE',
197: NVL(TO_CHAR(P_INTEREST_line_ID), 'null'));
198: fnd_msg_pub.add;
191: CLOSE c;
192:
193: IF l_rec.INTEREST_line_ID IS NULL THEN
194: fnd_message.set_name('AR', 'HZ_API_NO_RECORD');
195: fnd_message.set_token('RECORD', 'ar_interest_lines');
196: fnd_message.set_token('VALUE',
197: NVL(TO_CHAR(P_INTEREST_line_ID), 'null'));
198: fnd_msg_pub.add;
199: RAISE fnd_api.g_exc_error;
192:
193: IF l_rec.INTEREST_line_ID IS NULL THEN
194: fnd_message.set_name('AR', 'HZ_API_NO_RECORD');
195: fnd_message.set_token('RECORD', 'ar_interest_lines');
196: fnd_message.set_token('VALUE',
197: NVL(TO_CHAR(P_INTEREST_line_ID), 'null'));
198: fnd_msg_pub.add;
199: RAISE fnd_api.g_exc_error;
200: END IF;
204: (x_object_version_number IS NOT NULL AND
205: l_rec.OBJECT_VERSION_NUMBER IS NOT NULL AND
206: x_object_version_number = l_rec.OBJECT_VERSION_NUMBER))
207: THEN
208: fnd_message.set_name('AR', 'HZ_API_RECORD_CHANGED');
209: fnd_message.set_token('TABLE', 'ar_interest_lines');
210: fnd_msg_pub.add;
211: RAISE fnd_api.g_exc_error;
212: END IF;
205: l_rec.OBJECT_VERSION_NUMBER IS NOT NULL AND
206: x_object_version_number = l_rec.OBJECT_VERSION_NUMBER))
207: THEN
208: fnd_message.set_name('AR', 'HZ_API_RECORD_CHANGED');
209: fnd_message.set_token('TABLE', 'ar_interest_lines');
210: fnd_msg_pub.add;
211: RAISE fnd_api.g_exc_error;
212: END IF;
213:
248: arp_util.debug('EXCEPTION AR_INTEREST_BATCHES_PKG.update_line :'||x_msg_data);
249: WHEN OTHERS THEN
250: ROLLBACK TO SAVEPOINT Update_line;
251: x_return_status := fnd_api.g_ret_sts_unexp_error;
252: fnd_message.set_name('AR', 'HZ_API_OTHERS_EXCEP');
253: fnd_message.set_token('ERROR' ,SQLERRM);
254: fnd_msg_pub.add;
255: fnd_msg_pub.count_and_get(p_encoded => fnd_api.g_false,
256: p_count => x_msg_count,
249: WHEN OTHERS THEN
250: ROLLBACK TO SAVEPOINT Update_line;
251: x_return_status := fnd_api.g_ret_sts_unexp_error;
252: fnd_message.set_name('AR', 'HZ_API_OTHERS_EXCEP');
253: fnd_message.set_token('ERROR' ,SQLERRM);
254: fnd_msg_pub.add;
255: fnd_msg_pub.count_and_get(p_encoded => fnd_api.g_false,
256: p_count => x_msg_count,
257: p_data => x_msg_data);
290: FETCH c INTO l_rec;
291: CLOSE c;
292:
293: IF l_rec.INTEREST_line_ID IS NULL THEN
294: fnd_message.set_name('AR', 'HZ_API_NO_RECORD');
295: fnd_message.set_token('RECORD', 'ar_interest_lines');
296: fnd_message.set_token('VALUE',
297: NVL(TO_CHAR(P_INTEREST_line_ID), 'null'));
298: fnd_msg_pub.add;
291: CLOSE c;
292:
293: IF l_rec.INTEREST_line_ID IS NULL THEN
294: fnd_message.set_name('AR', 'HZ_API_NO_RECORD');
295: fnd_message.set_token('RECORD', 'ar_interest_lines');
296: fnd_message.set_token('VALUE',
297: NVL(TO_CHAR(P_INTEREST_line_ID), 'null'));
298: fnd_msg_pub.add;
299: RAISE fnd_api.g_exc_error;
292:
293: IF l_rec.INTEREST_line_ID IS NULL THEN
294: fnd_message.set_name('AR', 'HZ_API_NO_RECORD');
295: fnd_message.set_token('RECORD', 'ar_interest_lines');
296: fnd_message.set_token('VALUE',
297: NVL(TO_CHAR(P_INTEREST_line_ID), 'null'));
298: fnd_msg_pub.add;
299: RAISE fnd_api.g_exc_error;
300: END IF;
304: (x_object_version_number IS NOT NULL AND
305: l_rec.OBJECT_VERSION_NUMBER IS NOT NULL AND
306: x_object_version_number = l_rec.OBJECT_VERSION_NUMBER))
307: THEN
308: fnd_message.set_name('AR', 'HZ_API_RECORD_CHANGED');
309: fnd_message.set_token('TABLE', 'ar_interest_lines');
310: fnd_msg_pub.add;
311: RAISE fnd_api.g_exc_error;
312: END IF;
305: l_rec.OBJECT_VERSION_NUMBER IS NOT NULL AND
306: x_object_version_number = l_rec.OBJECT_VERSION_NUMBER))
307: THEN
308: fnd_message.set_name('AR', 'HZ_API_RECORD_CHANGED');
309: fnd_message.set_token('TABLE', 'ar_interest_lines');
310: fnd_msg_pub.add;
311: RAISE fnd_api.g_exc_error;
312: END IF;
313:
335: arp_util.debug('EXCEPTION AR_INTEREST_BATCHES_PKG.delete_line :'||x_msg_data);
336: WHEN OTHERS THEN
337: ROLLBACK TO SAVEPOINT Delete_line;
338: x_return_status := fnd_api.g_ret_sts_unexp_error;
339: fnd_message.set_name('AR', 'HZ_API_OTHERS_EXCEP');
340: fnd_message.set_token('ERROR' ,SQLERRM);
341: fnd_msg_pub.add;
342: fnd_msg_pub.count_and_get(p_encoded => fnd_api.g_false,
343: p_count => x_msg_count,
336: WHEN OTHERS THEN
337: ROLLBACK TO SAVEPOINT Delete_line;
338: x_return_status := fnd_api.g_ret_sts_unexp_error;
339: fnd_message.set_name('AR', 'HZ_API_OTHERS_EXCEP');
340: fnd_message.set_token('ERROR' ,SQLERRM);
341: fnd_msg_pub.add;
342: fnd_msg_pub.count_and_get(p_encoded => fnd_api.g_false,
343: p_count => x_msg_count,
344: p_data => x_msg_data);