1 PACKAGE BODY GR_UPDATE_REBUILD_IND AS
2 /*$Header: GRPRBLDB.pls 120.1 2005/09/06 14:36:36 pbamb noship $*/
3
4 /*
5 ** PROCEDURE :
6 ** Update_Rebuild_Flag
7 **
8 ** DESCRIPTION:
9 ** This procedure takes the entry from p_update_action, as defined below
10 ** and for all occurrences of the update code in documents, marks the
11 ** item document combination for rebuild.
12 **
13 ** The first step is to re-explode all items where required and then,
14 ** based on the update action, read the tables and ultimately mark the
15 ** relevant item document combination for rebuild.
16 **
17 ** NOTE: If the item has a production formula specified, the program will
18 ** call the OPM_410_MSDS_Formula routine. This is done because the
19 ** 11i explosion performs and app_exception if the return status is
20 ** not 'S' for successful. This works fine if the 11i routine is
21 ** called from a form, but destroys this procedure!
22 **
23 ** PARAMETERS:
24 ** errbuf - Error Buffer for the Concurrent program
25 ** retcode - Return Status code for concurrent Program
26 ** p_commit - Commit Flag
27 ** p_init_msg_list - Initialisation of the Message List
28 ** p_validation_level - Level of Validation
29 ** p_api_version - Version of the API
30 ** p_called_by_form - The procedure is called by Form or not
31 ** p_update_action - To determine which criteria to consider for
32 ** the rebuild flag to be updated
33 **
34 ** 1 - Update all documents for all items
35 ** 2 - Update range of documents for all item
36 ** 3 - Update Specific documents for all item
37 ** 4 - Update all items using a specified document code
38 ** 5 - Update Specific items for all documents
39 **
40 ** p_update_code - Item/Document code to control the update.
41 ** p_update_code1 - Item/Document code to control the update.
42 ** x_return_status - Return Status for the procedure
43 ** x_msg_count - Message count for the Procedure
44 ** x_msg_data - Message data for the Procedure
45 **
46 ** SYNOPSIS:
47 ** Update_Rebuild_Flag(errbuf, retcode, FALSE, 'T', 'T', 99, TO_CHAR(1.0), 'T',
48 ** p_update_action, p_update_code, p_update_code1,
49 ** x_return_status, x_msg_count, x_msg_data);
50 **
51 ** HISTORY:
52 ** 12-JUN-2001 Mercy Thomas BUG 1766048 Added this procedure to update
53 ** the rebuild Indicator
54 ** 11-Feb-2003 GK Bug 2190522 Made changes to the section update action = 4
55 ** and also I am only checking for items exploding for all
56 ** other update actions except 4.
57 */
58
59 PROCEDURE Update_Rebuild_Flag
60 (errbuf OUT NOCOPY VARCHAR2,
61 retcode OUT NOCOPY VARCHAR2,
62 p_commit IN VARCHAR2,
63 p_init_msg_list IN VARCHAR2,
64 p_validation_level IN NUMBER,
65 p_api_version IN NUMBER,
66 p_called_by_form IN VARCHAR2,
67 p_update_action IN NUMBER,
68 p_update_code IN VARCHAR2,
69 p_update_code1 IN VARCHAR2,
70 x_return_status OUT NOCOPY VARCHAR2,
71 x_msg_count OUT NOCOPY NUMBER,
72 x_msg_data OUT NOCOPY VARCHAR2)
73 IS
74 BEGIN
75
76 NULL;
77 x_return_status := FND_API.G_RET_STS_SUCCESS;
78
79 EXCEPTION
80
81 WHEN OTHERS THEN
82 x_return_status := FND_API.G_RET_STS_SUCCESS;
83
84
85 END Update_Rebuild_Flag;
86
87 /*
88 ** PROCEDURE :
89 ** Handle_Error_Messages
90 **
91 ** DESCRIPTION:
92 ** This procedure is called from the EXCEPTION handlers
93 ** in other procedures. It is passed the message code,
94 ** token name and token value.
95 **
96 ** The procedure will then process the error message into
97 ** the message stack and then return to the calling routine.
98 ** The procedure assumes all messages used are in the
99 ** application id 'GR'.
100 **
101 ** PARAMETERS:
102 ** p_called_by_form - The procedure is called from a Form or not
103 ** p_message_code - Message Code
104 ** p_token_name - Name of the Token
105 ** p_token_value - Token Value
106 ** x_msg_count - Message count for the Procedure
107 ** x_msg_data - Message data for the Procedure
108 ** x_return_status - Return Status for the procedure
109 **
110 ** SYNOPSIS:
111 ** Handle_Error_Messages('T', p_message_code, p_token_name, p_token_value,
112 ** x_msg_count, x_msg_data, x_return_status);
113 **
114 ** HISTORY:
115 ** 12-JUN-2001 Mercy Thomas BUG 1766048 Added this procedure to update
116 ** the rebuild Indicator
117 **
118 **
119 */
120
121 PROCEDURE Handle_Error_Messages
122 (p_called_by_form IN VARCHAR2,
123 p_message_code IN VARCHAR2,
124 p_token_name IN VARCHAR2,
125 p_token_value IN VARCHAR2,
126 x_msg_count IN OUT NOCOPY NUMBER,
127 x_msg_data IN OUT NOCOPY VARCHAR2,
128 x_return_status OUT NOCOPY VARCHAR2)
129 IS
130 BEGIN
131
132 NULL;
133 x_return_status := FND_API.G_RET_STS_SUCCESS;
134
135 EXCEPTION
136
137 WHEN OTHERS THEN
138 x_return_status := FND_API.G_RET_STS_SUCCESS;
139
140 END Handle_Error_Messages;
141
142
143 /*
144 ** The procedure checks to see if the item code is used
145 ** in another item, either as an ingredient or as an intermediate.
146 **
147 ** The next stage is to check for and update any generic items.
148 */
149
150 PROCEDURE Get_Item_Usage
151 (p_commit IN VARCHAR2,
152 p_called_by_form IN VARCHAR2,
153 p_item_code IN VARCHAR2,
154 p_document_code IN VARCHAR2,
155 x_msg_data OUT NOCOPY VARCHAR2,
156 x_return_status OUT NOCOPY VARCHAR2)
157 IS
158 BEGIN
159
160 NULL;
161 x_return_status := FND_API.G_RET_STS_SUCCESS;
162
163 EXCEPTION
164
165 WHEN OTHERS THEN
166 x_return_status := FND_API.G_RET_STS_SUCCESS;
167 END Get_Item_Usage;
168
169 END GR_UPDATE_REBUILD_IND;