4 * Provides the ability to cancel Purchasing documents directly through
1 PACKAGE PO_Document_Control_PUB AUTHID CURRENT_USER AS
2 /* $Header: POXPDCOS.pls 120.1.12020000.2 2013/02/10 14:43:09 vegajula ship $ */
3 /*#
5 * an API.
6 *
10 *
7 * The API performs all of the same processing that would be done if a
8 * cancellation was
9 * requested through the PO Summary Form Control window.
11 * @rep:scope public
12 * @rep:product PO
13 * @rep:displayname Purchase Order Document Control APIs
14 *
15 * @rep:category BUSINESS_ENTITY PO_BLANKET_PURCHASE_AGREEMENT
16 * @rep:category BUSINESS_ENTITY PO_CONTRACT_PURCHASE_AGREEMENT
17 * @rep:category BUSINESS_ENTITY PO_GLOBAL_BLANKET_AGREEMENT
18 * @rep:category BUSINESS_ENTITY PO_GLOBAL_CONTRACT_AGREEMENT
19 * @rep:category BUSINESS_ENTITY PO_STANDARD_PURCHASE_ORDER
20 * @rep:category BUSINESS_ENTITY PO_BLANKET_RELEASE
21 * @rep:category BUSINESS_ENTITY PO_PLANNED_PURCHASE_ORDER
22 * @rep:category BUSINESS_ENTITY PO_PLANNED_RELEASE
23 */
24
25 g_pkg_name CONSTANT VARCHAR2(30) := 'PO_Document_Control_PUB';
26
27
28
29 /*
30 * TYPE: PO_DTLS_RECORD
31 *
32 * Descriptions and examples:
33 *
34 * p_doc_type : Document Type - 'PO', 'PA' or 'RELEASE'
35 * p_doc_subtype : Document SubType- 'STANDARD','BLANKET','CONTRACT','SCHEDULED', etc.
36 * p_doc_id : Internal ID for Purchase Order
37 * p_doc_num : Document Num for Purchase Order.
38 * p_release_id : Internal ID for Release
39 * p_release_num : Release Number
40 * p_doc_line_id : Internal ID for PO Line
41 * p_doc_line_num : PO Line Number
42 * p_doc_line_loc_id : Internal ID for PO Shipment
43 * p_doc_shipment_num: Po Shipment Number
44 *
45 */
46 TYPE PO_DTLS_RECORD IS RECORD (
47 p_doc_id NUMBER,
48 p_doc_num po_headers_all.segment1%TYPE,
49 p_release_id NUMBER,
50 p_release_num NUMBER,
51 p_doc_line_id NUMBER,
52 p_doc_line_num NUMBER,
53 p_doc_line_loc_id NUMBER,
54 p_doc_shipment_num NUMBER,
55 p_doc_type PO_DOCUMENT_TYPES.document_type_code%TYPE,
56 p_doc_subtype PO_DOCUMENT_TYPES.document_subtype%TYPE
57 );
58
59 TYPE PO_DTLS_REC_TBL IS TABLE OF PO_DTLS_RECORD;
60
61
62 /*#
63 * Provides the ability to cancel Purchasing documents directly through
64 * an API.
65 *
66 * The API performs all of the same processing that would be done if a
67 * cancellation was requested through the PO Summary Form Control
68 * window.
69 *
70 * @param p_api_version Null not allowed. Value should match the
71 * current version of the API (currently 1.0). Used by the API to
72 * determine compatibility of API and calling program.
73 * @rep:paraminfo {@rep:required}
74 *
75 * @param p_init_msg_list Must be FND_API.G_TRUE. Used by API callers
76 * to ask the API to initialize the message list (for returning
77 * messages).
78 * @rep:paraminfo {@rep:required}
79 *
80 * @param p_commit Must be FND_API.G_TRUE. Used by API callers to ask
81 * the API to commit on their behalf after performing its function.
82 * For action action this must be used to prevent data inconsistencies.
83 * @rep:paraminfo {@rep:required}
84 *
85 * @param x_return_status Possible Values are:
86 * 'S' = SUCCESS - Cancellation completed without errors.
87 * 'E' = ERROR - Cancellation resulted in an error.
88 * 'U' = UNEXPECTED ERROR - Unexpected error.
89 * @rep:paraminfo {@rep:required}
90 *
91 * @param p_doc_type Null not allowed. Possible Values are: 'PO', 'PA',
92 * or 'RELEASE
93 * @rep:paraminfo {@rep:required}
94 *
95 * @param p_doc_subtype Null not allowed. Possible Values are STANDARD,
96 * PLANNED, BLANKET, CONTRACT, or SCHEDULED.
97 * @rep:paraminfo {@rep:required}
98 *
99 * @param p_doc_id IN NUMBER Internal ID for Purchase Order.
100 * Either p_doc_id or p_doc_num required. (i.e.
101 * PO_HEADERS_ALL.po_header_id)
102 * @rep:paraminfo {@rep:required}
103 *
104 * @param p_doc_num IN NUMBER Document Num for Purchase Order.
105 * Either p_doc_id or p_doc_num required.(i.e. PO_HEADERS_ALL.segment1)
106 * @rep:paraminfo {@rep:required}
107 *
108 * @param p_release_id Internal ID for Release. If Doc Type is Release
109 * either p_release_id or p_release_num required (i.e.
110 * PO_RELEASES_ALL.po_release_id)
111 * @rep:paraminfo {@rep:required}
112 *
113 * @param p_release_num Release Number. If Doc Type is Release either
114 * p_release_id or p_release_num required (i.e.
115 * PO_RELEASES_ALL.release_num)
116 * @rep:paraminfo {@rep:required}
117 *
118 * @param P_doc_line_id May be used to cancel a single line (and all
119 * its shipments). If cancelling a line or shipment, either
120 * p_doc_line_id or p_doc_line_num is required. (i.e.
121 * PO_LINES_ALL.po_line_id)
122 * @rep:paraminfo {@rep:required}
123 *
124 * @param p_doc_line_num Used to Cancel a single line (and all its
125 * shipments).If cancelling a line or shipment, either p_doc_line_id or
126 * p_doc_line_num is required (i.e. PO_LINES_ALL.line_num)
127 * @rep:paraminfo {@rep:required}
128 *
129 * @param p_doc_line_loc_id Used to Cancel a single shipment. If
130 * cancelling shipment either p_doc_line_loc_id or p_doc_shipment_id is
131 * required (i.e. PO_LINE_LOCATIONS_ALL.line_location_id)
132 * @rep:paraminfo {@rep:required}
133 *
134 * @param p_doc_shipment_num Used to Cancel a single shipment. If
135 * cancelling shipment either p_doc_line_loc_id or p_doc_shipment_id is
136 * required (i.e. PO_LINE_LOCATIONS_ALL.shipment_num)
137 * @rep:paraminfo {@rep:required}
141 *
138 *
139 * @param p_action Null not allowed. Value should be 'CANCEL'
140 * @rep:paraminfo {@rep:required}
142 * @param p_action_date Defaults to Sysdate. Date to be used for Cancel
143 * Date. Also use for encumbrance reversal if encumbrance accounting is
144 * used.
145 * @rep:paraminfo {@rep:required}
146 *
147 * @param p_cancel_reason Reason to be recorded in cancel reason.
148 * @rep:paraminfo {@rep:innertype PO_LINES.cancel_reason}
149 * {@rep:required}
150 *
151 * @param p_cancel_reqs_flag Value should be 'Y' or 'N'. Used to
152 * perform cancellation of backing requisition, if one exists.
153 * @rep:paraminfo {@rep:required}
154 *
155 * @param p_print_flag Default 'N'. Used to print purchase order after
156 * cancellation.
157 * @rep:paraminfo {@rep:required}
158 *
159 * @param p_note_to_vendor Used to create a note to supplier to store
160 * on the document and print.
161 * @rep:paraminfo {@rep:innertype PO_HEADERS.note_to_vendor}
162 *
163 * @param p_use_gldate Value should be 'Y' or 'N'.Defaults to 'N'.
164 * Determines to which period the unreserved funds should be allocated.
165 * @rep:paraminfo {@rep:required}
166 *
167 * @param p_org_id Internal ID for Operating Unit to which document
168 * belongs. Not required if the document belongs to Current operating Unit
169 * or to the the Default Operating.
170 * @rep:paraminfo {@rep:innertype PO_HEADERS_ALL.org_id}
171 *
172 * @rep:displayname API that performs the control action p_action on
173 * the specified document.
174 *
175 */
176 PROCEDURE control_document
177 (p_api_version IN NUMBER,
178 p_init_msg_list IN VARCHAR2,
179 p_commit IN VARCHAR2,
180 x_return_status OUT NOCOPY VARCHAR2,
181 p_doc_type IN PO_DOCUMENT_TYPES.document_type_code%TYPE,
182 p_doc_subtype IN PO_DOCUMENT_TYPES.document_subtype%TYPE,
183 p_doc_id IN NUMBER,
184 p_doc_num IN PO_HEADERS.segment1%TYPE,
185 p_release_id IN NUMBER,
186 p_release_num IN NUMBER,
187 p_doc_line_id IN NUMBER,
188 p_doc_line_num IN NUMBER,
189 p_doc_line_loc_id IN NUMBER,
190 p_doc_shipment_num IN NUMBER,
191 p_action IN VARCHAR2,
192 p_action_date IN DATE,
193 p_cancel_reason IN PO_LINES.cancel_reason%TYPE,
194 p_cancel_reqs_flag IN VARCHAR2,
195 p_print_flag IN VARCHAR2,
196 p_note_to_vendor IN PO_HEADERS.note_to_vendor%TYPE,
197 p_use_gldate IN VARCHAR2 DEFAULT NULL, -- <ENCUMBRANCE FPJ>
198 p_org_id IN NUMBER DEFAULT NULL, --<Bug#4581621>
199 p_launch_approvals_flag IN VARCHAR2 DEFAULT 'Y' --<Bug#14605476>
200 );
201
202
203 /*#
204 * Provides the ability to cancel Purchasing documents in bulk directly through
205 * an API.
206 *
207 * The API performs all of the same processing that would be done if a
208 * cancellation was requested through the PO Summary Form Control
209 * window.
210 *
211 * @param p_api_version Null not allowed. Value should match the
212 * current version of the API (currently 1.0). Used by the API to
213 * determine compatibility of API and calling program.
214 * @rep:paraminfo {@rep:required}
215 *
216 * @param p_init_msg_list Must be FND_API.G_TRUE. Used by API callers
217 * to ask the API to initialize the message list (for returning
218 * messages).
219 * @rep:paraminfo {@rep:required}
220 *
221 * @param p_commit Must be FND_API.G_TRUE. Used by API callers to ask
222 * the API to commit on their behalf after performing its function.
223 * For action action this must be used to prevent data inconsistencies.
224 * @rep:paraminfo {@rep:required}
225 *
226 * @param x_return_status Possible Values are:
227 * 'S' = SUCCESS - Cancellation completed without errors.
228 * 'E' = ERROR - Cancellation resulted in an error.
229 * 'U' = UNEXPECTED ERROR - Unexpected error.
230 * @rep:paraminfo {@rep:required}
231 *
232 * @param po_doc_tbl Null not allowed.
233 *
234 * Need to be populated as explained below:
235 *
236 * - p_doc_type Null not allowed. Possible Values are: 'PO', 'PA',
237 * or 'RELEASE
238 * - p_doc_subtype Null not allowed. Possible Values are STANDARD,
239 * PLANNED, BLANKET, CONTRACT, or SCHEDULED.
240 * - p_doc_id IN NUMBER Internal ID for Purchase Order.
241 * Either p_doc_id or p_doc_num required. (i.e.
242 * PO_HEADERS_ALL.po_header_id)
243 * - p_doc_num IN NUMBER Document Num for Purchase Order.
244 * Either p_doc_id or p_doc_num required.(i.e. PO_HEADERS_ALL.segment1)
245 * - p_release_id Internal ID for Release. If Doc Type is Release
246 * either p_release_id or p_release_num required (i.e.
247 * PO_RELEASES_ALL.po_release_id)
248 * - p_release_num Release Number. If Doc Type is Release either
249 * p_release_id or p_release_num required (i.e.
250 * PO_RELEASES_ALL.release_num)
251 * - P_doc_line_id May be used to cancel a single line (and all
252 * its shipments). If cancelling a line or shipment, either
253 * p_doc_line_id or p_doc_line_num is required. (i.e.
254 * PO_LINES_ALL.po_line_id)
255 * - p_doc_line_num Used to Cancel a single line (and all its
256 * shipments).If cancelling a line or shipment, either p_doc_line_id or
257 * p_doc_line_num is required (i.e. PO_LINES_ALL.line_num)
258 * - p_doc_line_loc_id Used to Cancel a single shipment. If
259 * cancelling shipment either p_doc_line_loc_id or p_doc_shipment_id is
260 * required (i.e. PO_LINE_LOCATIONS_ALL.line_location_id)
261 * - p_doc_shipment_num Used to Cancel a single shipment. If
265 *
262 * cancelling shipment either p_doc_line_loc_id or p_doc_shipment_id is
263 * required (i.e. PO_LINE_LOCATIONS_ALL.shipment_num)
264 * @rep:paraminfo {@rep:required}
266 * @param p_action Null not allowed. Value should be 'CANCEL'
267 * @rep:paraminfo {@rep:required}
268 *
269 * @param p_action_date Defaults to Sysdate. Date to be used for Cancel
270 * Date. Also use for encumbrance reversal if encumbrance accounting is
271 * used.
272 * @rep:paraminfo {@rep:required}
273 *
274 * @param p_cancel_reason Reason to be recorded in cancel reason.
275 * @rep:paraminfo {@rep:innertype PO_LINES.cancel_reason}
276 * {@rep:required}
277 *
278 * @param p_cancel_reqs_flag Value should be 'Y' or 'N'. Used to
279 * perform cancellation of backing requisition, if one exists.
280 * @rep:paraminfo {@rep:required}
281 *
282 * @param p_print_flag Default 'N'. Used to print purchase order after
283 * cancellation.
284 * @rep:paraminfo {@rep:required}
285 *
286 * @param p_note_to_vendor Used to create a note to supplier to store
287 * on the document and print.
288 * @rep:paraminfo {@rep:innertype PO_HEADERS.note_to_vendor}
289 *
290 * @param p_use_gldate Value should be 'Y' or 'N'.Defaults to 'N'.
291 * Determines to which period the unreserved funds should be allocated.
292 * @rep:paraminfo {@rep:required}
293 *
294 * @param p_org_id Internal ID for Operating Unit to which document
295 * belongs. Not required if the document belongs to Current operating Unit
296 * or to the the Default Operating.
297 * @rep:paraminfo {@rep:innertype PO_HEADERS_ALL.org_id}
298 *
299 * @rep:displayname API that performs the control action p_action on
300 * the specified document.
301 *
302 */
303 PROCEDURE control_document
307 x_return_status OUT NOCOPY VARCHAR2,
304 (p_api_version IN NUMBER,
305 p_init_msg_list IN VARCHAR2,
306 p_commit IN VARCHAR2,
308 po_doc_tbl IN po_document_control_pub.PO_DTLS_REC_TBL,
309 p_action IN VARCHAR2,
310 p_action_date IN DATE,
311 p_cancel_reason IN PO_LINES.cancel_reason%TYPE,
312 p_cancel_reqs_flag IN VARCHAR2,
313 p_print_flag IN VARCHAR2,
314 p_revert_chg_flag IN VARCHAR2,
315 p_launch_approvals_flag IN VARCHAR2,
316 p_note_to_vendor IN PO_HEADERS.note_to_vendor%TYPE,
317 p_use_gldate IN VARCHAR2 DEFAULT NULL,
318 p_org_id IN NUMBER DEFAULT NULL
319 );
320
321 END PO_Document_Control_PUB;