1 PACKAGE jmf_shikyu_adjustment_proc AS
2 --$Header: JMFRSKDS.pls 120.10 2006/06/22 10:17:46 nesoni noship $
3 --+===========================================================================+
4 --| Copyright (c) 2005 Oracle Corporation |
5 --| Redwood Shores, California, USA |
6 --| All rights reserved. |
7 --+===========================================================================+
8 --| FILENAME : JMFRSKDS.pls |
9 --| |
10 --| DESCRIPTION: Specification file for the private package |
11 --| containing the logic of Component Consumption |
12 --| Adjustments. |
13 --| It includes the main procedures to be invoked |
14 --| by the Consumption Adjusments Concurrent Program. |
15 --| |
16 --| HISTORY: |
17 --| 28-MAY-2005 shu Created. |
18 --| 12-JUL-2005 vchu Removed the init procedure. |
19 --| 06-OCT-2005 shu Added x_chr_errbuff,x_chr_retcode parameters |
20 --| to adjustments_worker. |
21 --| 12-DEC-2005 shu added check_workers_status procedure for |
22 --| checking the status of adjustment workers |
23 --| 21-JUN-2006 nesoni added get_total_adjustments function for |
24 --| getting total adjustments corresponding to |
25 --| poShipmentId and ShikyuComponentId. |
26 --+===========================================================================+
27
28 g_pkg_name CONSTANT VARCHAR2(30) := 'JMF_SHIKYU_ADJUSTMENT_PROC';
29
30 --========================================================================
31 -- PROCEDURE : adjustments_manager PUBLIC ,
32 -- PARAMETERS: x_chr_errbuff varchar out parameter for current program
33 -- x_chr_retcode varchar out parameter for current program
34 -- p_batch_size Number of records in a batch
35 -- p_max_workers Maximum number of workers allowed
36 -- COMMENT : for submit adjustment concurrent manually , the group_id is ignored
37 -- PRE-COND :
38 -- EXCEPTIONS:
39 --========================================================================
40 PROCEDURE adjustments_manager
41 ( x_chr_errbuff OUT NOCOPY VARCHAR2 /*to store error msg*/
42 , x_chr_retcode OUT NOCOPY VARCHAR2 /*to store return code*/
43 , p_batch_size IN NUMBER
44 , p_max_workers IN NUMBER
45 );
46
47 --========================================================================
48 -- PROCEDURE : check_workers_status PUBLIC
49 -- PARAMETERS: p_workers Identifier of the submitted requests
50 -- x_return_status the status of worker request, if not 'NORMAL'
51 -- COMMENT :
52 -- PRE-COND :
53 -- EXCEPTIONS:
54 --========================================================================
55 PROCEDURE check_workers_status
56 (p_workers IN jmf_shikyu_util.g_request_tbl_type
57 ,x_return_status OUT NOCOPY VARCHAR2
58 );
59
60 --========================================================================
61 -- PROCEDURE : adjustments_worker PUBLIC
62 -- PARAMETERS: x_chr_errbuff varchar out parameter for current program
63 -- x_chr_retcode varchar out parameter for current program
64 -- p_batch_id Identifier of the batch of rows to be processed
65 -- COMMENT :
66 -- PRE-COND :
67 -- EXCEPTIONS:
68 --========================================================================
69 PROCEDURE adjustments_worker
70 (
71 x_chr_errbuff OUT NOCOPY VARCHAR2 /*to store error msg*/ --errbuf??
72 ,x_chr_retcode OUT NOCOPY VARCHAR2 /*to store return code*/ --retcode ??
73 ,p_batch_id IN NUMBER
74 );
75
76 --========================================================================
77 -- PROCEDURE : adjust_consumption PUBLIC ,
78 -- PARAMETERS: p_batch_id Identifier of the batch of rows to be processed
79 -- : x_return_status return status
80 -- COMMENT : This is the main procedure to be kicked off by the Consumptioin Adjustments
81 -- Concurrent Program. It sorts the adjustment records in ascending order of
82 -- the adjustment amount and then processes each record by calling either the
83 -- Adjust_Positive or the Adjust_Negative procedure.
84 -- PRE-COND :
85 -- EXCEPTIONS:
86 --========================================================================
87 PROCEDURE adjust_consumption
88 ( p_batch_id IN NUMBER
89 , x_return_status OUT NOCOPY VARCHAR2
90 );
91
92 --========================================================================
93 -- PROCEDURE : adjust_positive PUBLIC ,
94 -- PARAMETERS: p_subcontract_po_shipment_id Unique Identifier of the Subcontracting
95 -- Order Shipment whose component consumption is to be adjusted.
96 -- p_component_id p_component_id Identifier of the SHIKYU Component
97 -- for which the consumption is to be adjusted.
98 -- p_adjustment_amount Amount to adjust the component consumtion by.
99 -- p_uom Unit of Measure of the adjustment amount.
100 -- x_return_status return status.
101 -- COMMENT : This procedure processes an adjustment record with a positive adjustment amount,
102 -- meaning that the Manufacturing Partner has over-utilized the SHIKYU Component.
103 -- PRE-COND :
104 -- EXCEPTIONS:
105 --========================================================================
106 PROCEDURE adjust_positive
107 ( p_subcontract_po_shipment_id IN NUMBER
108 , p_component_id IN NUMBER
109 , p_adjustment_amount IN NUMBER
110 , p_uom IN VARCHAR2
111 , x_return_status OUT NOCOPY VARCHAR2
112 );
113
114 --========================================================================
115 -- PROCEDURE : adjust_negative PUBLIC ,
116 -- PARAMETERS: p_subcontract_po_shipment_id Unique Identifier of the Subcontracting
117 -- Order Shipment whose component consumption is to be adjusted.
118 -- p_component_id p_component_id Identifier of the SHIKYU Component
119 -- for which the consumption is to be adjusted.
120 -- p_adjustment_amount Amount to adjust the component consumtion by.
121 -- p_uom Unit of Measure of the adjustment amount.
122 -- x_return_status return status.
123 -- COMMENT : This procedure processes an adjustment record with a negative adjustment amount,
124 -- meaning that the Manufacturing Partner has under-utilized the SHIKYU Component.
125 -- PRE-COND :
126 -- EXCEPTIONS:
127 --========================================================================
128 PROCEDURE adjust_negative
129 ( p_subcontract_po_shipment_id IN NUMBER
130 , p_component_id IN NUMBER
131 , p_adjustment_amount IN NUMBER
132 , p_uom IN VARCHAR2
133 , x_return_status OUT NOCOPY VARCHAR2
134 );
135
136 --========================================================================
137 -- FUNCTION : get_total_adjustments PUBLIC ,
138 -- PARAMETERS: p_po_shipment_id Subcontracting Purchase Order Shipment Id
139 -- p_component_id component Id of OSA item
140 -- COMMENT : Function for getting total adjustments corresponding to
141 -- poShipmentId and ShikyuComponentId.
142 -- RETURN : NUMBER Returns total adjusted value
143 -- PRE-COND :
144 -- EXCEPTIONS:
145 --========================================================================
146 FUNCTION get_total_adjustments
147 ( p_po_shipment_id IN NUMBER
148 , p_component_id IN NUMBER
149 ) RETURN NUMBER;
150
151 END jmf_shikyu_adjustment_proc;
152