17: p_status_code IN VARCHAR2) IS
18: BEGIN
19: OPEN x_status FOR
20: SELECT status_code, status_id
21: FROM mtl_material_statuses_vl
22: WHERE zone_control = 1
23: and enabled_flag = 1
24: and status_code like (p_status_code)
25: order by status_code;
30: p_status_code IN VARCHAR2) IS
31: BEGIN
32: OPEN x_status FOR
33: SELECT status_code, status_id
34: FROM mtl_material_statuses_vl
35: WHERE locator_control = 1
36: and enabled_flag = 1
37: and status_code like (p_status_code)
38: order by status_code;
43: p_status_code IN VARCHAR2) IS
44: BEGIN
45: OPEN x_status FOR
46: SELECT status_code, status_id
47: FROM mtl_material_statuses_vl
48: WHERE lot_control = 1
49: and enabled_flag = 1
50: and status_code like (p_status_code)
51: order by status_code;
56: p_status_code IN VARCHAR2) IS
57: BEGIN
58: OPEN x_status FOR
59: SELECT status_code, status_id
60: FROM mtl_material_statuses_vl
61: WHERE serial_control = 1
62: and enabled_flag = 1
63: and status_code like (p_status_code)
64: order by status_code;
70: p_status_code IN VARCHAR2) IS
71: BEGIN
72: OPEN x_status FOR
73: SELECT status_code, status_id
74: FROM mtl_material_statuses_vl
75: WHERE onhand_control = 1
76: and enabled_flag = 1
77: and status_code like (p_status_code)
78: order by status_code;
103: /* Bug 10331520: Modified the query to filter out the statuses
104: * for which the given transaction is not allowed*/
105: OPEN x_status FOR
106: SELECT mms.status_code, mms.status_id
107: FROM mtl_material_statuses_vl mms
108: WHERE mms.onhand_control = 1
109: and mms.enabled_flag = 1
110: and mms.status_code like (p_status_code)
111: and not exists ( select 1 from mtl_status_transaction_control mstc
116:
117: ELSIF (l_org_default_status_id > 0) THEN
118: OPEN x_status FOR
119: SELECT mms.status_code, mms.status_id
120: FROM mtl_material_statuses_vl mms
121: WHERE mms.onhand_control = 1
122: and mms.enabled_flag = 1
123: and mms.status_code like (p_status_code)
124: order by mms.status_code;
125:
126: ELSIF (p_trx_type_id IS NOT NULL) THEN
127: OPEN x_status FOR
128: SELECT mms.status_code, mms.status_id
129: FROM mtl_material_statuses_vl mms
130: WHERE mms.lot_control = 1
131: and mms.enabled_flag = 1
132: and mms.status_code like (p_status_code)
133: and not exists ( select 1 from mtl_status_transaction_control mstc
138:
139: ELSE
140: OPEN x_status FOR
141: SELECT status_code, status_id
142: FROM mtl_material_statuses_vl
143: WHERE lot_control = 1
144: and enabled_flag = 1
145: and status_code like (p_status_code)
146: order by status_code;
158: /* Bug 10331520: Modified the query to filter out the statuses
159: * for which the given transaction is not allowed*/
160: OPEN x_status FOR
161: SELECT mms.status_code, mms.status_id
162: FROM mtl_material_statuses_vl mms
163: WHERE mms.serial_control = 1
164: and mms.enabled_flag = 1
165: and mms.status_code like (p_status_code)
166: and not exists ( select 1 from mtl_status_transaction_control mstc
170: order by mms.status_code;
171: ELSE
172: OPEN x_status FOR
173: SELECT status_code, status_id
174: FROM mtl_material_statuses_vl
175: WHERE serial_control = 1
176: and enabled_flag = 1
177: and status_code like (p_status_code)
178: order by status_code;