1 PACKAGE eam_mtl_txn_process AUTHID CURRENT_USER AS
2 /* $Header: EAMMTTXS.pls 120.1.12020000.2 2012/08/13 13:56:54 rsandepo ship $ */
3 Procedure PROCESSMTLTXN(
4 p_txn_header_id IN NUMBER,
5 p_item_id IN OUT NOCOPY NUMBER,
6 p_item IN VARCHAR2 := NULL,
7 p_revision IN VARCHAR2 := NULL,
8 p_org_id IN OUT NOCOPY NUMBER,
9 p_trx_action_id IN NUMBER ,
10 p_subinv_code IN OUT NOCOPY VARCHAR2 ,
11 p_tosubinv_code IN VARCHAR2 := NULL,
12 p_locator_id IN OUT NOCOPY NUMBER,
13 p_locator IN VARCHAR2 := NULL,
14 p_tolocator_id IN NUMBER := NULL,
15 p_trx_type_id IN NUMBER ,
16 p_trx_src_type_id IN NUMBER ,
17 p_trx_qty IN NUMBER ,
18 p_pri_qty IN NUMBER ,
19 p_uom IN VARCHAR2 ,
20 p_date IN DATE := sysdate,
21 p_reason_id IN OUT NOCOPY NUMBER,
22 p_reason IN VARCHAR2 := NULL ,
23 p_user_id IN NUMBER ,
24 p_trx_src_id IN NUMBER := NULL,
25 x_trx_temp_id OUT NOCOPY NUMBER ,
26 p_operation_seq_num IN NUMBER := NULL,
27 p_wip_entity_type IN NUMBER := NULL,
28 p_trx_reference IN VARCHAR2 := NULL,
29 p_negative_req_flag IN NUMBER := NULL,
30 p_serial_ctrl_code IN NUMBER := NULL,
31 p_lot_ctrl_code IN NUMBER := NULL,
32 p_from_ser_number IN VARCHAR2 := NULL,
33 P_to_ser_number IN VARCHAR2 := NULL,
34 p_lot_num IN VARCHAR2 := NULL,
35 p_wip_supply_type IN NUMBER := NULL,
36 p_subinv_ctrl IN NUMBER := 0,
37 p_locator_ctrl IN NUMBER := 0,
38 p_del_alloc_mat_req IN VARCHAR2 := 'N', -- Added for ER bug# 13839846
39 p_wip_process IN NUMBER := NULL, -- determines to call WIP Transaction API
40 -- 0 -> No call,1 -> Call
41 p_dateNotInFuture IN NUMBER := 1, -- 1 --> do check,0 --> no check
42 x_error_flag OUT NOCOPY NUMBER, -- returns 0 if no error ,
43 -- 1 if any error ,error message name will be in x_error_mssg,
44 -- 2 if any error ,error message itself will be in x_error_mssg.
45 x_error_mssg OUT NOCOPY VARCHAR2
46 ) ;
47
48 /* This Procedure will return Locator control for a specified
49 ** Organization,Subinventory,Item combination based on the
50 ** Locator Control definition at those 3 levels .More over this
51 ** API does take care of allowing 'Dynamic Entry' control based
52 ** on Organization level Negative Inv flag,Item level Restrict
53 ** Locator flag and Specified Action .
54 */
55 Procedure Get_LocatorControl_Code(
56 p_org IN NUMBER,
57 p_subinv IN VARCHAR2,
58 p_item_id IN NUMBER,
59 p_action IN NUMBER,
60 x_locator_ctrl OUT NOCOPY NUMBER,
61 x_error_flag OUT NOCOPY NUMBER, -- returns 0 if no error ,1 if any error .
62 x_error_mssg OUT NOCOPY VARCHAR2
63 ) ;
64
65 /* This procedure will process the request for more of Inventory Item */
66
67 PROCEDURE MoreMaterial_Add
68 (
69 p_api_version IN NUMBER,
70 p_init_msg_list IN VARCHAR2 := FND_API.G_TRUE,
71 p_commit IN VARCHAR2 := FND_API.G_FALSE,
72 p_validation_level IN NUMBER := FND_API.G_VALID_LEVEL_FULL,
73
74 p_work_object_id IN NUMBER,
75 p_organization_id IN NUMBER,
76 p_operation_seq_num IN NUMBER,
77 p_item_id IN NUMBER,
78 p_required_quantity IN NUMBER,
79 p_requested_quantity IN NUMBER,
80 p_supply_subinventory IN VARCHAR2 DEFAULT NULL, --12.1 source sub project
81 p_supply_locator_id IN NUMBER DEFAULT NULL, --12.1 source sub project
82
83
84 x_return_status OUT NOCOPY VARCHAR2,
85 x_msg_count OUT NOCOPY NUMBER,
86 x_msg_data OUT NOCOPY VARCHAR2
87
88 );
89
90 /* This procedure will process the request for more of Direct Item */
91
92 PROCEDURE MoreDirectItem_Add
93 (
94 p_api_version IN NUMBER,
95 p_init_msg_list IN VARCHAR2 := FND_API.G_TRUE,
96 p_commit IN VARCHAR2 := FND_API.G_FALSE,
97 p_validation_level IN NUMBER := FND_API.G_VALID_LEVEL_FULL,
98
99 p_work_object_id IN NUMBER,
100 p_organization_id IN NUMBER,
101 p_operation_seq_num IN NUMBER,
102 p_direct_item_type IN NUMBER,
103 p_item_id IN NUMBER,
104 p_need_by_date IN DATE,
105 p_required_quantity IN NUMBER,
106 p_requested_quantity IN NUMBER,
107
108 x_return_status OUT NOCOPY VARCHAR2,
109 x_msg_count OUT NOCOPY NUMBER,
110 x_msg_data OUT NOCOPY VARCHAR2
111
112 );
113 /*This procedure is called from the self service side page Re. New Inventory Items page.
114 It calls the wo api.
115 */
116 PROCEDURE insert_into_wro(
117 p_api_version IN NUMBER
118 ,p_init_msg_list IN VARCHAR2 := fnd_api.g_false
119 ,p_commit IN VARCHAR2 := fnd_api.g_false
120 ,p_validation_level IN NUMBER := fnd_api.g_valid_level_full
121 ,p_wip_entity_id IN NUMBER
122 ,p_organization_id IN NUMBER
123 ,p_inventory_item_id IN NUMBER
124 ,p_description IN VARCHAR2
125 ,p_operation_seq_num IN NUMBER
126 ,p_supply IN NUMBER
127 ,p_mode IN VARCHAR2 := 'INSERT'
128 ,p_required_date IN DATE
129 ,p_quantity IN NUMBER
130 ,p_comments IN VARCHAR2
131 ,p_supply_subinventory IN VARCHAR2
132 ,p_locator IN VARCHAR2
133 ,p_mrp_net_flag IN VARCHAR2
134 ,p_material_release IN VARCHAR2
135 ,x_return_status OUT NOCOPY VARCHAR2
136 ,x_msg_count OUT NOCOPY NUMBER
137 ,x_msg_data OUT NOCOPY VARCHAR2
138 );
139
140
141 PROCEDURE insert_into_wdi(
142 p_api_version IN NUMBER
143 ,p_init_msg_list IN VARCHAR2 := fnd_api.g_false
144 ,p_commit IN VARCHAR2 := fnd_api.g_false
145 ,p_validation_level IN NUMBER := fnd_api.g_valid_level_full
146 ,p_wip_entity_id IN NUMBER
147 ,p_organization_id IN NUMBER
148 ,p_direct_item_seq_id IN NUMBER := NULL
149 ,p_description IN VARCHAR2
150 ,p_operation_seq_num IN NUMBER
151 ,p_mode IN VARCHAR2 := 'INSERT'
152 ,p_direct_item_type IN VARCHAR2 :='1'
153 ,p_purchasing_category_id NUMBER :=null
154 ,p_suggested_vendor_id NUMBER :=null
155 ,p_suggested_vendor_name VARCHAR2 :=null
156 ,p_suggested_vendor_site VARCHAR2 :=null
157 ,p_suggested_vendor_contact VARCHAR2 :=null
158 ,p_suggested_vendor_phone VARCHAR2 :=null,
159 p_suggested_vendor_item_num VARCHAR2 :=null,
160 p_unit_price NUMBER :=null,
161 p_auto_request_material VARCHAR2 :=null,
162 p_required_quantity NUMBER :=null,
163 p_uom VARCHAR2 :=null,
164 p_need_by_date DATE :=null
165 ,x_return_status OUT NOCOPY VARCHAR2
166 ,x_msg_count OUT NOCOPY NUMBER
167 ,x_msg_data OUT NOCOPY VARCHAR2
168 );
169
170 /* This Function will return 'Y' if Locator entry is allowed
171 ** for a specified Organization,Subinventory,Item combinations .
172 */
173 Function Is_LocatorControlled(
174 p_org IN NUMBER,
175 p_subinv IN VARCHAR2,
176 p_item_id IN NUMBER,
177 p_action IN NUMBER
178 ) return VARCHAR2;
179
180 /* This function will return TRUE if 'Dynamic Entry' control
181 ** is allowed based on Organization level Negative Inv flag,Item
182 ** level Restrict Locator flag and Specified Action .
183 */
184 Function Dynamic_Entry_Not_Allowed(
185 p_restrict_flag IN NUMBER,
186 p_neg_flag IN NUMBER,
187 p_action IN NUMBER) return Boolean ;
188
189 END eam_mtl_txn_process;