DBA Data[Home] [Help]

PACKAGE BODY: APPS.PO_MASSCANCEL_SV

Source


1 PACKAGE BODY PO_MASSCANCEL_SV as
2 /* $Header: POXTIMCB.pls 115.0 99/07/17 02:05:02 porting ship $ */
3 
4 /***************************************************************************
5  *
6  *	Procedure:	lock_row
7  *
8  *	Description:	LOCK_ROW table handler for the PO_MASSCANCEL_INTERIM
9  * 			table.
10  *
11  **************************************************************************/
12 
13  PROCEDURE lock_row (x_rowid 		  	VARCHAR2,
14 		     x_default_cancel_flag	VARCHAR2)
15 
16  IS
17    CURSOR C IS
18         SELECT *
19         FROM   PO_MASSCANCEL_INTERIM
20         WHERE  rowid = x_rowid
21         FOR UPDATE of default_cancel_flag NOWAIT;
22     Recinfo C%ROWTYPE;
23 
24  BEGIN
25     OPEN C;
26     FETCH C INTO Recinfo;
27     if (C%NOTFOUND) then
28       CLOSE C;
29       FND_MESSAGE.Set_Name('FND', 'FORM_RECORD_DELETED');
30       APP_EXCEPTION.Raise_Exception;
31     end if;
32     CLOSE C;
33     if (Recinfo.default_cancel_flag = x_default_cancel_flag) then
34       return;
35     else
36       /* Not using the regular fnd message, since that tells the
37        * user that he/she should requery. Here we are forcing the
38        * the requery. This is required due to the fact that we are
39        * using multiselect and that highlights/de-highlights the rec
40        * irrespective of lock failure, even though the cancel flag is
41        * not updated if the lock fails.
42        */
43       --FND_MESSAGE.Set_Name('FND', 'FORM_RECORD_CHANGED');
44 	fnd_message.set_name('PO', 'PO_ALL_LOCK_FAILED_REQUERYING');
45       APP_EXCEPTION.RAISE_EXCEPTION;
46     end if;
47  END lock_row;
48 
49 
50 /***************************************************************************
51  *
52  *	Procedure:	update_row
53  *
54  *	Description:	UPDATE table handler for the PO_MASSCANCEL_INTERIM
55  * 			table.
56  *
57  **************************************************************************/
58 
59   PROCEDURE update_row(x_rowid                 VARCHAR2,
60                        x_last_update_date      DATE,
61                        x_last_updated_by       NUMBER,
62 		       x_last_update_login     NUMBER,
63 		       x_default_cancel_flag   VARCHAR2)
64 
65    IS
66  BEGIN
67    UPDATE PO_MASSCANCEL_INTERIM
68    SET		default_cancel_flag	=	x_default_cancel_flag,
69 		last_update_date 	=      	x_last_update_date,
70               	last_updated_by		=	x_last_updated_by,
71 		last_update_login	=	x_last_update_login
72    WHERE rowid = x_rowid;
73 
74     if (SQL%NOTFOUND) then
75       Raise NO_DATA_FOUND;
76     end if;
77 
78   END update_row;
79 
80 
81 END PO_MASSCANCEL_SV;