4: l_debug varchar2(30) := 'Y';
5: g_dblink VARCHAR2(129);
6:
7: g_po_numbers po_tbl_varchar100;
8: g_po_header_ids po_tbl_number;
9: g_po_line_ids po_tbl_number;
10: g_line_location_ids po_tbl_number;
11: g_distribution_ids po_tbl_number;
12: g_qtys po_tbl_number;
5: g_dblink VARCHAR2(129);
6:
7: g_po_numbers po_tbl_varchar100;
8: g_po_header_ids po_tbl_number;
9: g_po_line_ids po_tbl_number;
10: g_line_location_ids po_tbl_number;
11: g_distribution_ids po_tbl_number;
12: g_qtys po_tbl_number;
13: g_promise_dates po_tbl_date;
6:
7: g_po_numbers po_tbl_varchar100;
8: g_po_header_ids po_tbl_number;
9: g_po_line_ids po_tbl_number;
10: g_line_location_ids po_tbl_number;
11: g_distribution_ids po_tbl_number;
12: g_qtys po_tbl_number;
13: g_promise_dates po_tbl_date;
14: g_uoms po_tbl_varchar30;
7: g_po_numbers po_tbl_varchar100;
8: g_po_header_ids po_tbl_number;
9: g_po_line_ids po_tbl_number;
10: g_line_location_ids po_tbl_number;
11: g_distribution_ids po_tbl_number;
12: g_qtys po_tbl_number;
13: g_promise_dates po_tbl_date;
14: g_uoms po_tbl_varchar30;
15: g_operating_units po_tbl_number;
8: g_po_header_ids po_tbl_number;
9: g_po_line_ids po_tbl_number;
10: g_line_location_ids po_tbl_number;
11: g_distribution_ids po_tbl_number;
12: g_qtys po_tbl_number;
13: g_promise_dates po_tbl_date;
14: g_uoms po_tbl_varchar30;
15: g_operating_units po_tbl_number;
16: g_current_rec NUMBER := 1;
11: g_distribution_ids po_tbl_number;
12: g_qtys po_tbl_number;
13: g_promise_dates po_tbl_date;
14: g_uoms po_tbl_varchar30;
15: g_operating_units po_tbl_number;
16: g_current_rec NUMBER := 1;
17: g_current_org_id NUMBER := NULL;
18:
19: /********************************************************
46: WHEN OTHERS THEN
47: RAISE;
48: END debug_message;
49:
50: PROCEDURE debug_number_tbl( p_msg IN VARCHAR2, p_tbl IN po_tbl_number ) IS
51: i NUMBER;
52: BEGIN
53: debug_message(p_msg || ' number of changes: ' || p_tbl.COUNT() );
54: FOR i IN 1..p_tbl.COUNT() LOOP
255: debug_message('p_dblink' || p_dblink ||'l_dblink ' || l_dblink);
256:
257: g_dblink := l_dblink;
258: g_current_rec := 1;
259: g_po_header_ids := po_tbl_number();
260: g_line_location_ids := po_tbl_number();
261: g_distribution_ids := po_tbl_number();
262: g_qtys := po_tbl_number();
263: g_promise_dates := po_tbl_date();
256:
257: g_dblink := l_dblink;
258: g_current_rec := 1;
259: g_po_header_ids := po_tbl_number();
260: g_line_location_ids := po_tbl_number();
261: g_distribution_ids := po_tbl_number();
262: g_qtys := po_tbl_number();
263: g_promise_dates := po_tbl_date();
264: g_uoms := po_tbl_varchar30();
257: g_dblink := l_dblink;
258: g_current_rec := 1;
259: g_po_header_ids := po_tbl_number();
260: g_line_location_ids := po_tbl_number();
261: g_distribution_ids := po_tbl_number();
262: g_qtys := po_tbl_number();
263: g_promise_dates := po_tbl_date();
264: g_uoms := po_tbl_varchar30();
265: g_operating_units := po_tbl_number();
258: g_current_rec := 1;
259: g_po_header_ids := po_tbl_number();
260: g_line_location_ids := po_tbl_number();
261: g_distribution_ids := po_tbl_number();
262: g_qtys := po_tbl_number();
263: g_promise_dates := po_tbl_date();
264: g_uoms := po_tbl_varchar30();
265: g_operating_units := po_tbl_number();
266:
261: g_distribution_ids := po_tbl_number();
262: g_qtys := po_tbl_number();
263: g_promise_dates := po_tbl_date();
264: g_uoms := po_tbl_varchar30();
265: g_operating_units := po_tbl_number();
266:
267: IF( l_dblink IS NOT NULL ) THEN
268: debug_message('Get data from dblink ' || l_dblink);
269: transfer_to_temp_table( l_dblink, l_instance_id, p_batch_id );
381: FUNCTION get_next_record (
382: x_po_header_id OUT nocopy NUMBER,
383: x_po_number OUT nocopy VARCHAR2,
384: x_operating_unit OUT nocopy NUMBER,
385: x_po_line_ids OUT nocopy po_tbl_number,
386: x_line_location_ids OUT nocopy po_tbl_number,
387: x_distribution_ids OUT nocopy po_tbl_number,
388: x_qtys OUT nocopy po_tbl_number,
389: x_promise_dates OUT nocopy po_tbl_date,
382: x_po_header_id OUT nocopy NUMBER,
383: x_po_number OUT nocopy VARCHAR2,
384: x_operating_unit OUT nocopy NUMBER,
385: x_po_line_ids OUT nocopy po_tbl_number,
386: x_line_location_ids OUT nocopy po_tbl_number,
387: x_distribution_ids OUT nocopy po_tbl_number,
388: x_qtys OUT nocopy po_tbl_number,
389: x_promise_dates OUT nocopy po_tbl_date,
390: x_uoms OUT nocopy po_tbl_varchar30
383: x_po_number OUT nocopy VARCHAR2,
384: x_operating_unit OUT nocopy NUMBER,
385: x_po_line_ids OUT nocopy po_tbl_number,
386: x_line_location_ids OUT nocopy po_tbl_number,
387: x_distribution_ids OUT nocopy po_tbl_number,
388: x_qtys OUT nocopy po_tbl_number,
389: x_promise_dates OUT nocopy po_tbl_date,
390: x_uoms OUT nocopy po_tbl_varchar30
391: ) RETURN BOOLEAN IS
384: x_operating_unit OUT nocopy NUMBER,
385: x_po_line_ids OUT nocopy po_tbl_number,
386: x_line_location_ids OUT nocopy po_tbl_number,
387: x_distribution_ids OUT nocopy po_tbl_number,
388: x_qtys OUT nocopy po_tbl_number,
389: x_promise_dates OUT nocopy po_tbl_date,
390: x_uoms OUT nocopy po_tbl_varchar30
391: ) RETURN BOOLEAN IS
392: /*
433:
434: END LOOP;
435: ***********/
436:
437: x_po_line_ids := po_tbl_number();
438: x_line_location_ids := po_tbl_number();
439: x_distribution_ids := po_tbl_number();
440: x_qtys := po_tbl_number();
441: x_promise_dates := po_tbl_date();
434: END LOOP;
435: ***********/
436:
437: x_po_line_ids := po_tbl_number();
438: x_line_location_ids := po_tbl_number();
439: x_distribution_ids := po_tbl_number();
440: x_qtys := po_tbl_number();
441: x_promise_dates := po_tbl_date();
442: x_uoms := po_tbl_varchar30();
435: ***********/
436:
437: x_po_line_ids := po_tbl_number();
438: x_line_location_ids := po_tbl_number();
439: x_distribution_ids := po_tbl_number();
440: x_qtys := po_tbl_number();
441: x_promise_dates := po_tbl_date();
442: x_uoms := po_tbl_varchar30();
443:
436:
437: x_po_line_ids := po_tbl_number();
438: x_line_location_ids := po_tbl_number();
439: x_distribution_ids := po_tbl_number();
440: x_qtys := po_tbl_number();
441: x_promise_dates := po_tbl_date();
442: x_uoms := po_tbl_varchar30();
443:
444: IF( g_distribution_ids(l_starting_rec) IS NOT NULL ) THEN
618:
619: l_po_return_status VARCHAR2(1);
620: l_po_api_errors PO_API_ERRORS_REC_TYPE;
621:
622: l_po_line_ids po_tbl_number;
623: l_line_location_ids po_tbl_number;
624: l_distribution_ids po_tbl_number;
625: l_qtys po_tbl_number;
626: l_promise_dates po_tbl_date;
619: l_po_return_status VARCHAR2(1);
620: l_po_api_errors PO_API_ERRORS_REC_TYPE;
621:
622: l_po_line_ids po_tbl_number;
623: l_line_location_ids po_tbl_number;
624: l_distribution_ids po_tbl_number;
625: l_qtys po_tbl_number;
626: l_promise_dates po_tbl_date;
627: l_uoms po_tbl_varchar30;
620: l_po_api_errors PO_API_ERRORS_REC_TYPE;
621:
622: l_po_line_ids po_tbl_number;
623: l_line_location_ids po_tbl_number;
624: l_distribution_ids po_tbl_number;
625: l_qtys po_tbl_number;
626: l_promise_dates po_tbl_date;
627: l_uoms po_tbl_varchar30;
628:
621:
622: l_po_line_ids po_tbl_number;
623: l_line_location_ids po_tbl_number;
624: l_distribution_ids po_tbl_number;
625: l_qtys po_tbl_number;
626: l_promise_dates po_tbl_date;
627: l_uoms po_tbl_varchar30;
628:
629: l_po_line_changes po_lines_rec_type;