1 PACKAGE eam_mtl_txn_process AS
2 /* $Header: EAMMTTXS.pls 120.1 2007/11/29 03:26:14 mashah 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_wip_process IN NUMBER := NULL, -- determines to call WIP Transaction API
39 -- 0 -> No call,1 -> Call
40 p_dateNotInFuture IN NUMBER := 1, -- 1 --> do check,0 --> no check
41 x_error_flag OUT NOCOPY NUMBER, -- returns 0 if no error ,
42 -- 1 if any error ,error message name will be in x_error_mssg,
43 -- 2 if any error ,error message itself will be in x_error_mssg.
44 x_error_mssg OUT NOCOPY VARCHAR2
45 ) ;
46
47 /* This Procedure will return Locator control for a specified
48 ** Organization,Subinventory,Item combination based on the
49 ** Locator Control definition at those 3 levels .More over this
50 ** API does take care of allowing 'Dynamic Entry' control based
51 ** on Organization level Negative Inv flag,Item level Restrict
52 ** Locator flag and Specified Action .
53 */
54 Procedure Get_LocatorControl_Code(
55 p_org IN NUMBER,
56 p_subinv IN VARCHAR2,
57 p_item_id IN NUMBER,
58 p_action IN NUMBER,
59 x_locator_ctrl OUT NOCOPY NUMBER,
60 x_error_flag OUT NOCOPY NUMBER, -- returns 0 if no error ,1 if any error .
61 x_error_mssg OUT NOCOPY VARCHAR2
62 ) ;
63
64 /* This procedure will process the request for more of Inventory Item */
65
66 PROCEDURE MoreMaterial_Add
67 (
68 p_api_version IN NUMBER,
69 p_init_msg_list IN VARCHAR2 := FND_API.G_TRUE,
70 p_commit IN VARCHAR2 := FND_API.G_FALSE,
71 p_validation_level IN NUMBER := FND_API.G_VALID_LEVEL_FULL,
72
73 p_work_object_id IN NUMBER,
74 p_organization_id IN NUMBER,
75 p_operation_seq_num IN NUMBER,
76 p_item_id IN NUMBER,
77 p_required_quantity IN NUMBER,
78 p_requested_quantity IN NUMBER,
79 p_supply_subinventory IN VARCHAR2 DEFAULT NULL, --12.1 source sub project
80 p_supply_locator_id IN NUMBER DEFAULT NULL, --12.1 source sub project
81
82
83 x_return_status OUT NOCOPY VARCHAR2,
84 x_msg_count OUT NOCOPY NUMBER,
85 x_msg_data OUT NOCOPY VARCHAR2
86
87 );
88
89 /* This procedure will process the request for more of Direct Item */
90
91 PROCEDURE MoreDirectItem_Add
92 (
93 p_api_version IN NUMBER,
94 p_init_msg_list IN VARCHAR2 := FND_API.G_TRUE,
95 p_commit IN VARCHAR2 := FND_API.G_FALSE,
96 p_validation_level IN NUMBER := FND_API.G_VALID_LEVEL_FULL,
97
98 p_work_object_id IN NUMBER,
99 p_organization_id IN NUMBER,
100 p_operation_seq_num IN NUMBER,
101 p_direct_item_type IN NUMBER,
102 p_item_id IN NUMBER,
103 p_need_by_date IN DATE,
104 p_required_quantity IN NUMBER,
105 p_requested_quantity IN NUMBER,
106
107 x_return_status OUT NOCOPY VARCHAR2,
108 x_msg_count OUT NOCOPY NUMBER,
109 x_msg_data OUT NOCOPY VARCHAR2
110
111 );
112 /*This procedure is called from the self service side page Re. New Inventory Items page.
113 It calls the wo api.
114 */
115 PROCEDURE insert_into_wro(
116 p_api_version IN NUMBER
117 ,p_init_msg_list IN VARCHAR2 := fnd_api.g_false
118 ,p_commit IN VARCHAR2 := fnd_api.g_false
119 ,p_validation_level IN NUMBER := fnd_api.g_valid_level_full
120 ,p_wip_entity_id IN NUMBER
121 ,p_organization_id IN NUMBER
122 ,p_inventory_item_id IN NUMBER
123 ,p_description IN VARCHAR2
124 ,p_operation_seq_num IN NUMBER
125 ,p_supply IN NUMBER
126 ,p_mode IN VARCHAR2 := 'INSERT'
127 ,p_required_date IN DATE
128 ,p_quantity IN NUMBER
129 ,p_comments IN VARCHAR2
130 ,p_supply_subinventory IN VARCHAR2
131 ,p_locator IN VARCHAR2
132 ,p_mrp_net_flag IN VARCHAR2
133 ,p_material_release IN VARCHAR2
134 ,x_return_status OUT NOCOPY VARCHAR2
135 ,x_msg_count OUT NOCOPY NUMBER
136 ,x_msg_data OUT NOCOPY VARCHAR2
137 );
138
139
140 PROCEDURE insert_into_wdi(
141 p_api_version IN NUMBER
142 ,p_init_msg_list IN VARCHAR2 := fnd_api.g_false
143 ,p_commit IN VARCHAR2 := fnd_api.g_false
144 ,p_validation_level IN NUMBER := fnd_api.g_valid_level_full
145 ,p_wip_entity_id IN NUMBER
146 ,p_organization_id IN NUMBER
147 ,p_direct_item_seq_id IN NUMBER := NULL
148 ,p_description IN VARCHAR2
149 ,p_operation_seq_num IN NUMBER
150 ,p_mode IN VARCHAR2 := 'INSERT'
151 ,p_direct_item_type IN VARCHAR2 :='1'
152 ,p_purchasing_category_id NUMBER :=null
153 ,p_suggested_vendor_id NUMBER :=null
154 ,p_suggested_vendor_name VARCHAR2 :=null
155 ,p_suggested_vendor_site VARCHAR2 :=null
156 ,p_suggested_vendor_contact VARCHAR2 :=null
157 ,p_suggested_vendor_phone VARCHAR2 :=null,
158 p_suggested_vendor_item_num VARCHAR2 :=null,
159 p_unit_price NUMBER :=null,
160 p_auto_request_material VARCHAR2 :=null,
161 p_required_quantity NUMBER :=null,
162 p_uom VARCHAR2 :=null,
163 p_need_by_date DATE :=null
164 ,x_return_status OUT NOCOPY VARCHAR2
165 ,x_msg_count OUT NOCOPY NUMBER
166 ,x_msg_data OUT NOCOPY VARCHAR2
167 );
168
169 /* This Function will return 'Y' if Locator entry is allowed
170 ** for a specified Organization,Subinventory,Item combinations .
171 */
172 Function Is_LocatorControlled(
173 p_org IN NUMBER,
174 p_subinv IN VARCHAR2,
175 p_item_id IN NUMBER,
176 p_action IN NUMBER
177 ) return VARCHAR2;
178
179 /* This function will return TRUE if 'Dynamic Entry' control
180 ** is allowed based on Organization level Negative Inv flag,Item
181 ** level Restrict Locator flag and Specified Action .
182 */
183 Function Dynamic_Entry_Not_Allowed(
184 p_restrict_flag IN NUMBER,
185 p_neg_flag IN NUMBER,
186 p_action IN NUMBER) return Boolean ;
187
188 END eam_mtl_txn_process;