1 PACKAGE CZ_ATP_UTIL AS
2 /* $Header: czatpus.pls 120.0 2005/05/25 06:14:55 appldev noship $ */
3 -- Start of Comments
4 -- Package name: CZ_ATP_UTIL
5 --
6 -- Function: Package contains all CZ ATP utilities.
7 --
8 -- NOTES: 1. item quantities must always be provided in the item's
9 -- primary unit of measure
10 -- 2. insert_atp_request and get_atp_result currently commit
11 -- transactions, because "read only" Java side doesn't
12 -- currently manage transactions
13 --
14 -- End Of Comments
15
16 -- Global constants holding return status values.
17
18 G_RET_STS_SUCCESS CONSTANT CHAR := 'S';
19 G_RET_STS_ERROR CONSTANT CHAR := 'E';
20 G_RET_STS_UNEXP_ERROR CONSTANT CHAR := 'U';
21
22 -- Procedure insert_atp_request
23 -- Description:
24 -- Inserts data into the MTL_DEMAND_INTERFACE table for an ATP check
25 -- on an item. The insert_atp_request procedure should be called before
26 -- calling run_atp_check.
27 --
28 -- The p_atp_group_id parameter should be NULL if a new group ID should
29 -- be created. Subsequent calls to insert_atp_request can use the group
30 -- ID returned from this first call. Note that p_sequence_number must
31 -- be different for each call for a particular ATP group ID.
32 --
33 -- NOTE: insert_atp_request issues a commit after inserting record
34
35 PROCEDURE insert_atp_request (p_inventory_item_id IN NUMBER, p_organization_id IN NUMBER,
36 p_quantity IN NUMBER, p_atp_group_id IN OUT NOCOPY NUMBER,
37 p_return_status OUT NOCOPY VARCHAR2, p_error_message OUT NOCOPY VARCHAR2,
38 p_sequence_number IN NUMBER,
39 p_atp_rule_id IN NUMBER DEFAULT NULL);
40
41
42 -- Procedure run_atp_check
43 -- Usage:
44 -- Called from configurator screen to check ATP for an item
45 -- Description:
46 -- Runs the demand interface program (INXATP) to calculate
47 -- ATP dates for items in ATP group identified by p_atp_group_id.
48
49 PROCEDURE run_atp_check (p_return_status OUT NOCOPY VARCHAR2, p_error_message OUT NOCOPY VARCHAR2,
50 p_atp_group_id IN NUMBER, p_user_id IN NUMBER,
51 p_resp_id IN NUMBER, p_appl_id IN NUMBER,
52 p_timeout IN NUMBER);
53
54
55 -- Procedure get_atp_result
56 -- Description:
57 -- Retrieves earliest ATP date result from mtl_demand_interface for the
58 -- item identified by ATP group ID and sequence number. Deletes the line
59 -- from mtl_demand_interface after retrieval.
60 -- NOTE: insert_atp_request issues a commit after deleting record
61
62 PROCEDURE get_atp_result (p_atp_group_id IN NUMBER, p_earliest_atp_date OUT NOCOPY DATE,
63 p_return_status OUT NOCOPY VARCHAR2, p_error_message OUT NOCOPY VARCHAR2,
64 p_sequence_number IN NUMBER);
65
66
67 END CZ_ATP_UTIL;
68