184: FND_FILE.PUT_LINE(FND_FILE.LOG, ' Request Date Low = '|| to_char(l_request_date_low,'DD-MON-YYYY'));
185: FND_FILE.PUT_LINE(FND_FILE.LOG, ' Item = '|| p_item);
186: FND_FILE.PUT_LINE(FND_FILE.LOG, ' Cust PO Number = '|| p_customer_po_number);
187:
188: l_sqlCursor := DBMS_SQL.Open_Cursor;
189:
190: DBMS_SQL.PARSE(l_sqlCursor, l_sql_stmt, DBMS_SQL.NATIVE);
191:
192: -- Moac Start
186: FND_FILE.PUT_LINE(FND_FILE.LOG, ' Cust PO Number = '|| p_customer_po_number);
187:
188: l_sqlCursor := DBMS_SQL.Open_Cursor;
189:
190: DBMS_SQL.PARSE(l_sqlCursor, l_sql_stmt, DBMS_SQL.NATIVE);
191:
192: -- Moac Start
193: IF p_org_id IS NOT NULL THEN
194: DBMS_SQL.BIND_VARIABLE(l_sqlCursor,':bindvar_org_id',p_org_id);
190: DBMS_SQL.PARSE(l_sqlCursor, l_sql_stmt, DBMS_SQL.NATIVE);
191:
192: -- Moac Start
193: IF p_org_id IS NOT NULL THEN
194: DBMS_SQL.BIND_VARIABLE(l_sqlCursor,':bindvar_org_id',p_org_id);
195: END IF;
196: -- Moac End
197:
198: IF p_order_number_low IS NOT NULL THEN
195: END IF;
196: -- Moac End
197:
198: IF p_order_number_low IS NOT NULL THEN
199: DBMS_SQL.BIND_VARIABLE(l_sqlCursor,':p1',p_order_number_low);
200: END IF;
201: IF p_order_number_high IS NOT NULL THEN
202: dbms_sql.bind_variable(l_sqlCursor,':p2',p_order_number_high);
203: END IF;
198: IF p_order_number_low IS NOT NULL THEN
199: DBMS_SQL.BIND_VARIABLE(l_sqlCursor,':p1',p_order_number_low);
200: END IF;
201: IF p_order_number_high IS NOT NULL THEN
202: dbms_sql.bind_variable(l_sqlCursor,':p2',p_order_number_high);
203: END IF;
204: IF p_ship_to_location IS NOT NULL THEN
205: dbms_sql.bind_variable(l_sqlCursor,':p3',p_ship_to_location);
206: END IF;
201: IF p_order_number_high IS NOT NULL THEN
202: dbms_sql.bind_variable(l_sqlCursor,':p2',p_order_number_high);
203: END IF;
204: IF p_ship_to_location IS NOT NULL THEN
205: dbms_sql.bind_variable(l_sqlCursor,':p3',p_ship_to_location);
206: END IF;
207: IF p_order_type IS NOT NULL THEN
208: dbms_sql.bind_variable(l_sqlCursor,':p4',p_order_type);
209: END IF;
204: IF p_ship_to_location IS NOT NULL THEN
205: dbms_sql.bind_variable(l_sqlCursor,':p3',p_ship_to_location);
206: END IF;
207: IF p_order_type IS NOT NULL THEN
208: dbms_sql.bind_variable(l_sqlCursor,':p4',p_order_type);
209: END IF;
210: IF p_customer IS NOT NULL THEN
211: dbms_sql.bind_variable(l_sqlCursor,':p5',p_customer);
212: END IF;
207: IF p_order_type IS NOT NULL THEN
208: dbms_sql.bind_variable(l_sqlCursor,':p4',p_order_type);
209: END IF;
210: IF p_customer IS NOT NULL THEN
211: dbms_sql.bind_variable(l_sqlCursor,':p5',p_customer);
212: END IF;
213: IF l_request_date_low IS NOT NULL THEN
214: dbms_sql.bind_variable(l_sqlCursor,':p6',l_request_date_low);
215: END IF;
210: IF p_customer IS NOT NULL THEN
211: dbms_sql.bind_variable(l_sqlCursor,':p5',p_customer);
212: END IF;
213: IF l_request_date_low IS NOT NULL THEN
214: dbms_sql.bind_variable(l_sqlCursor,':p6',l_request_date_low);
215: END IF;
216: IF l_request_date_high IS NOT NULL THEN
217: dbms_sql.bind_variable(l_sqlCursor,':p7',l_request_date_high);
218: END IF;
213: IF l_request_date_low IS NOT NULL THEN
214: dbms_sql.bind_variable(l_sqlCursor,':p6',l_request_date_low);
215: END IF;
216: IF l_request_date_high IS NOT NULL THEN
217: dbms_sql.bind_variable(l_sqlCursor,':p7',l_request_date_high);
218: END IF;
219:
220: -- Moac Start.
221: IF p_item IS NOT NULL THEN
218: END IF;
219:
220: -- Moac Start.
221: IF p_item IS NOT NULL THEN
222: dbms_sql.bind_variable(l_sqlCursor,':p8',p_item);
223: END IF;
224:
225: IF p_customer_po_number IS NOT NULL THEN
226: dbms_sql.bind_variable(l_sqlCursor,':p9',p_customer_po_number);
222: dbms_sql.bind_variable(l_sqlCursor,':p8',p_item);
223: END IF;
224:
225: IF p_customer_po_number IS NOT NULL THEN
226: dbms_sql.bind_variable(l_sqlCursor,':p9',p_customer_po_number);
227: END IF;
228: -- Moac End.
229:
230: DBMS_SQL.DEFINE_COLUMN (l_sqlCursor,1,v_line_id);
226: dbms_sql.bind_variable(l_sqlCursor,':p9',p_customer_po_number);
227: END IF;
228: -- Moac End.
229:
230: DBMS_SQL.DEFINE_COLUMN (l_sqlCursor,1,v_line_id);
231: -- Moac
232: DBMS_SQL.DEFINE_COLUMN (l_sqlCursor,2,l_org_id);
233:
234:
228: -- Moac End.
229:
230: DBMS_SQL.DEFINE_COLUMN (l_sqlCursor,1,v_line_id);
231: -- Moac
232: DBMS_SQL.DEFINE_COLUMN (l_sqlCursor,2,l_org_id);
233:
234:
235: l_dummy := DBMS_SQL.execute(l_sqlCursor);
236:
231: -- Moac
232: DBMS_SQL.DEFINE_COLUMN (l_sqlCursor,2,l_org_id);
233:
234:
235: l_dummy := DBMS_SQL.execute(l_sqlCursor);
236:
237: LOOP
238:
239: IF DBMS_SQL.FETCH_ROWS(l_sqlCursor) = 0 THEN
235: l_dummy := DBMS_SQL.execute(l_sqlCursor);
236:
237: LOOP
238:
239: IF DBMS_SQL.FETCH_ROWS(l_sqlCursor) = 0 THEN
240: EXIT;
241: END IF;
242:
243: DBMS_SQL.COLUMN_VALUE(l_sqlCursor,1,v_line_id);
239: IF DBMS_SQL.FETCH_ROWS(l_sqlCursor) = 0 THEN
240: EXIT;
241: END IF;
242:
243: DBMS_SQL.COLUMN_VALUE(l_sqlCursor,1,v_line_id);
244: DBMS_SQL.COLUMN_VALUE(l_sqlCursor,2,l_org_id);
245:
246: IF Line_Eligible(p_line_id => v_line_id) THEN
247:
240: EXIT;
241: END IF;
242:
243: DBMS_SQL.COLUMN_VALUE(l_sqlCursor,1,v_line_id);
244: DBMS_SQL.COLUMN_VALUE(l_sqlCursor,2,l_org_id);
245:
246: IF Line_Eligible(p_line_id => v_line_id) THEN
247:
248: FND_FILE.PUT_LINE (FND_FILE.LOG, 'Processing Line ID => '||v_line_id);
306:
307: END IF;
308:
309: END LOOP;
310: DBMS_SQL.CLOSE_CURSOR(l_sqlCursor);
311:
312:
313: EXCEPTION
314: WHEN FND_API.G_EXC_ERROR THEN