1 PACKAGE BODY rcv_sub_locator_sv AS
2 /* $Header: RCVTXLOB.pls 115.2 2002/11/25 21:42:25 sbull ship $*/
3
4
5 /*===========================================================================
6
7 PROCEDURE NAME: put_away_api
8
9 DESCRIPTION:
10
11 This function is meant to be an user extensible feature that allows the
12 user to add derivation rules to set the default deliver subinventory
13 and locator_id. The Receipts, Transactions, and Returns forms in
14 Oracle Purchasing use this function to determine what the default value
15 for the sub and locator should be. If you wish to create you're own
16 rules for this function, then feel free to add any logic that you wish.
17
18 PARAMETERS:
19
20 x_line_location_id IN NUMBER - The primary key (line_location_id)
21 from the po_line_locations table
22 Only for Receipt_Source_Code = VENDOR
23
24 x_po_distribution_id IN NUMBER - The primary key (po_distribution_id)
25 from the po_distributions table
26 Only for Receipt_Source_Code = VENDOR
27
28 x_shipment_line_id IN NUMBER - The primary key (shipment_line_id)
29 from the rcv_shipment_lines table
30
31 x_receipt_source_code IN VARCHAR2- Describes the type of document the
32 shipment is based upon. Possible
33 values are 'INTERNAL ORDER' (for
34 internal requisition transaction),
35 'INVENTORY' (for in-transit
36 transaction),VENDOR (for purchase order
37 transaction). Source of this value is
38 SHIPMENT SOURCE TYPE lookup value from
39 po_lookup_codes.
40
41 x_ship_from_org_id IN NUMBER - Organization that the shipment came
42 from
43 Only for Receipt_Source_Code =
44 INTERNAL ORDER or INVENTORY
45
46
47 x_ship_to_org_id IN NUMBER - Destination Organization for the
48 shipment
49
50 x_item_id IN NUMBER - The item primary key from
51 mtl_system_items
52
53 x_item_revision IN VARCHAR2- The revision of the item that you are
54 transacting
55
56 x_vendor_id IN NUMBER - The vendor primary key from
57 po_vendors
58
59 x_ship_to_location_id IN NUMBER - The ship to location id primary key
60 from hr_locations
61
62 x_deliver_to_location_id IN NUMBER - The deliver to location id primary key
63 from hr_locations
64
65 x_deliver_to_person_id IN NUMBER - The deliver to person id primary key
66 from hr_employees
67
68 x_available_qty IN NUMBER - The quantity available to transact in
69 the parent unit of measure. The parent
70 being for a receipt the purchase order
71 line unit or for a inspection it's
72 the receipt unit.
73
74 x_uom IN VARCHAR2- Parent unit of measure. The parent
75 being for a receipt the purchase order
76 line unit or for a inspection it's
77 the receipt unit.
78
79 x_primary_qty IN NUMBER - The quantity available to transact in
80 the primary unit of measure
81
82 x_primary_uom IN VARCHAR2- Primary unit of measure.
83
84 x_tolerable_qty IN NUMBER - The maximum quantity that can be
85 transacted based on quantity
86 precentage tolerances. This is only
87 applicable to receipts since the max
88 for other transactions is what's
89 available for the parent transaction.
90
91 x_routing_id IN NUMBER - The routing definition for the shipment
92 1=Standard receipt, 2=Inspection
93 3=Direct Receipt
94 x_default_subinventory IN VARCHAR2- The default subinventory derived
95 using our standard rules and
96 functionality. For example, look at the
97 purchase order distribution, if you don't
98 find it there get it from the item. etc.
99 x_default_locator_id IN NUMBER - The default locator_id derived
100 using our standard rules and
101 functionality
102 x_subinventory IN OUT VARCHAR2 - The outbound subinventory that
103 you've derived
104 x_locator_id IN OUT NUMBER - The outbound locator_id that
105 you've derived
106
107 RETURN VALUE BOOLEAN - Not currently used
108
109 ===========================================================================*/
110
111 FUNCTION put_away_api ( x_line_location_id IN NUMBER,
112 x_po_distribution_id IN NUMBER,
113 x_shipment_line_id IN NUMBER,
114 x_receipt_source_code IN VARCHAR2,
115 x_ship_from_org_id IN NUMBER,
116 x_ship_to_org_id IN NUMBER,
117 x_item_id IN NUMBER,
118 x_item_revision IN VARCHAR2,
119 x_vendor_id IN NUMBER,
120 x_ship_to_location_id IN NUMBER,
121 x_deliver_to_location_id IN NUMBER,
122 x_deliver_to_person_id IN NUMBER,
123 x_available_qty IN NUMBER,
124 x_primary_qty IN NUMBER,
125 x_primary_uom IN VARCHAR2,
126 x_tolerable_qty IN NUMBER,
127 x_uom IN VARCHAR2,
128 x_routing_id IN NUMBER,
129 x_default_subinventory IN VARCHAR2,
130 x_default_locator_id IN NUMBER,
131 x_subinventory IN OUT NOCOPY VARCHAR2,
132 x_locator_id IN OUT NOCOPY NUMBER )
133 RETURN BOOLEAN IS
134
135 X_progress VARCHAR2(4) := '000';
136
137 BEGIN
138
139 X_progress := '010';
140
141 /*
142 ** Current functionality sets the outbound default subinventory and locator
143 ** to the defaults that were passed in. If you wish to create put away
144 ** rules other than standard defaulting logic then feel free to add to
145 ** this function. The last action of this function should be to set the
146 ** outbound subinventory and locator_id values. This will in turn be used
147 ** when querying the values for Enter Receipts, Enter Transactions, and
148 ** Enter Returns.
149 */
150 x_subinventory := x_default_subinventory;
151 x_locator_id := x_default_locator_id;
152
153 RETURN (TRUE);
154
155 EXCEPTION
156 WHEN OTHERS THEN
157 po_message_s.sql_error('rcv_express_sv.put_away_api', X_progress,
158 sqlcode);
159 RAISE;
160
161 END put_away_api;
162
163 END rcv_sub_locator_sv;