128: OPEN I;
129: FETCH I into x_sr_source_id;
130: IF (I%NOTFOUND) THEN
131: close I;
132: fnd_file.put_line(fnd_file.log, '** Cannot get sr_source_id');
133: raise NO_DATA_FOUND;
134: END IF;
135: CLOSE I;
136:
136:
137: -- Insert record into mpr_sr_source_org
138:
139: x_progress := '030';
140: fnd_file.put_line(fnd_file.log,'Adding vendor to sourcing rule. VENDOR_ID = '||x_vendor_id);
141:
142: INSERT INTO MRP_SR_SOURCE_ORG(
143: sr_source_id,
144: sr_receipt_id,
226: CLOSE C;
227:
228: EXCEPTION
229: WHEN OTHERS THEN
230: fnd_file.put_line(fnd_file.log, '** Exception in upgrade_autosource_vendors');
231: fnd_file.put_line(fnd_file.log, 'x_progress = '||x_progress);
232: PO_MESSAGE_S.SQL_ERROR('UPGRADE_AUTOSOURCE_VENDORS', x_progress, sqlcode);
233: END;
234:
227:
228: EXCEPTION
229: WHEN OTHERS THEN
230: fnd_file.put_line(fnd_file.log, '** Exception in upgrade_autosource_vendors');
231: fnd_file.put_line(fnd_file.log, 'x_progress = '||x_progress);
232: PO_MESSAGE_S.SQL_ERROR('UPGRADE_AUTOSOURCE_VENDORS', x_progress, sqlcode);
233: END;
234:
235: /*===========================================================================
325: OPEN I2;
326: FETCH I2 into x_asl_id;
327: IF (I2%NOTFOUND) THEN
328: close I2;
329: fnd_file.put_line(fnd_file.log, '** Cannot get asl_id');
330: raise NO_DATA_FOUND;
331: END IF;
332: CLOSE I2;
333:
331: END IF;
332: CLOSE I2;
333:
334: x_progress := '030';
335: fnd_file.put_line(fnd_file.log, 'x_item_id '||to_char(x_item_id));
336: fnd_file.put_line(fnd_file.log, 'x_asl_id '||to_char(x_asl_id));
337: fnd_file.put_line(fnd_file.log, 'x_vendor_id '||to_char(x_vendor_id));
338: fnd_file.put_line(fnd_file.log, 'x_asl_status_id '||to_char(x_asl_status_id));
339: fnd_file.put_line(fnd_file.log, 'x_creation_date '||to_char(x_creation_date));
332: CLOSE I2;
333:
334: x_progress := '030';
335: fnd_file.put_line(fnd_file.log, 'x_item_id '||to_char(x_item_id));
336: fnd_file.put_line(fnd_file.log, 'x_asl_id '||to_char(x_asl_id));
337: fnd_file.put_line(fnd_file.log, 'x_vendor_id '||to_char(x_vendor_id));
338: fnd_file.put_line(fnd_file.log, 'x_asl_status_id '||to_char(x_asl_status_id));
339: fnd_file.put_line(fnd_file.log, 'x_creation_date '||to_char(x_creation_date));
340: fnd_file.put_line(fnd_file.log, 'x_last_update_date '||to_char(x_last_update_date));
333:
334: x_progress := '030';
335: fnd_file.put_line(fnd_file.log, 'x_item_id '||to_char(x_item_id));
336: fnd_file.put_line(fnd_file.log, 'x_asl_id '||to_char(x_asl_id));
337: fnd_file.put_line(fnd_file.log, 'x_vendor_id '||to_char(x_vendor_id));
338: fnd_file.put_line(fnd_file.log, 'x_asl_status_id '||to_char(x_asl_status_id));
339: fnd_file.put_line(fnd_file.log, 'x_creation_date '||to_char(x_creation_date));
340: fnd_file.put_line(fnd_file.log, 'x_last_update_date '||to_char(x_last_update_date));
341: fnd_file.put_line(fnd_file.log, 'owning_org '||to_char(x_owning_organization_id));
334: x_progress := '030';
335: fnd_file.put_line(fnd_file.log, 'x_item_id '||to_char(x_item_id));
336: fnd_file.put_line(fnd_file.log, 'x_asl_id '||to_char(x_asl_id));
337: fnd_file.put_line(fnd_file.log, 'x_vendor_id '||to_char(x_vendor_id));
338: fnd_file.put_line(fnd_file.log, 'x_asl_status_id '||to_char(x_asl_status_id));
339: fnd_file.put_line(fnd_file.log, 'x_creation_date '||to_char(x_creation_date));
340: fnd_file.put_line(fnd_file.log, 'x_last_update_date '||to_char(x_last_update_date));
341: fnd_file.put_line(fnd_file.log, 'owning_org '||to_char(x_owning_organization_id));
342: fnd_file.put_line(fnd_file.log, 'update by '|| to_char(x_last_updated_by) );
335: fnd_file.put_line(fnd_file.log, 'x_item_id '||to_char(x_item_id));
336: fnd_file.put_line(fnd_file.log, 'x_asl_id '||to_char(x_asl_id));
337: fnd_file.put_line(fnd_file.log, 'x_vendor_id '||to_char(x_vendor_id));
338: fnd_file.put_line(fnd_file.log, 'x_asl_status_id '||to_char(x_asl_status_id));
339: fnd_file.put_line(fnd_file.log, 'x_creation_date '||to_char(x_creation_date));
340: fnd_file.put_line(fnd_file.log, 'x_last_update_date '||to_char(x_last_update_date));
341: fnd_file.put_line(fnd_file.log, 'owning_org '||to_char(x_owning_organization_id));
342: fnd_file.put_line(fnd_file.log, 'update by '|| to_char(x_last_updated_by) );
343: fnd_file.put_line(fnd_file.log, 'created by '||to_char(x_created_by) );
336: fnd_file.put_line(fnd_file.log, 'x_asl_id '||to_char(x_asl_id));
337: fnd_file.put_line(fnd_file.log, 'x_vendor_id '||to_char(x_vendor_id));
338: fnd_file.put_line(fnd_file.log, 'x_asl_status_id '||to_char(x_asl_status_id));
339: fnd_file.put_line(fnd_file.log, 'x_creation_date '||to_char(x_creation_date));
340: fnd_file.put_line(fnd_file.log, 'x_last_update_date '||to_char(x_last_update_date));
341: fnd_file.put_line(fnd_file.log, 'owning_org '||to_char(x_owning_organization_id));
342: fnd_file.put_line(fnd_file.log, 'update by '|| to_char(x_last_updated_by) );
343: fnd_file.put_line(fnd_file.log, 'created by '||to_char(x_created_by) );
344:
337: fnd_file.put_line(fnd_file.log, 'x_vendor_id '||to_char(x_vendor_id));
338: fnd_file.put_line(fnd_file.log, 'x_asl_status_id '||to_char(x_asl_status_id));
339: fnd_file.put_line(fnd_file.log, 'x_creation_date '||to_char(x_creation_date));
340: fnd_file.put_line(fnd_file.log, 'x_last_update_date '||to_char(x_last_update_date));
341: fnd_file.put_line(fnd_file.log, 'owning_org '||to_char(x_owning_organization_id));
342: fnd_file.put_line(fnd_file.log, 'update by '|| to_char(x_last_updated_by) );
343: fnd_file.put_line(fnd_file.log, 'created by '||to_char(x_created_by) );
344:
345: INSERT INTO PO_APPROVED_SUPPLIER_LIST(
338: fnd_file.put_line(fnd_file.log, 'x_asl_status_id '||to_char(x_asl_status_id));
339: fnd_file.put_line(fnd_file.log, 'x_creation_date '||to_char(x_creation_date));
340: fnd_file.put_line(fnd_file.log, 'x_last_update_date '||to_char(x_last_update_date));
341: fnd_file.put_line(fnd_file.log, 'owning_org '||to_char(x_owning_organization_id));
342: fnd_file.put_line(fnd_file.log, 'update by '|| to_char(x_last_updated_by) );
343: fnd_file.put_line(fnd_file.log, 'created by '||to_char(x_created_by) );
344:
345: INSERT INTO PO_APPROVED_SUPPLIER_LIST(
346: asl_id ,
339: fnd_file.put_line(fnd_file.log, 'x_creation_date '||to_char(x_creation_date));
340: fnd_file.put_line(fnd_file.log, 'x_last_update_date '||to_char(x_last_update_date));
341: fnd_file.put_line(fnd_file.log, 'owning_org '||to_char(x_owning_organization_id));
342: fnd_file.put_line(fnd_file.log, 'update by '|| to_char(x_last_updated_by) );
343: fnd_file.put_line(fnd_file.log, 'created by '||to_char(x_created_by) );
344:
345: INSERT INTO PO_APPROVED_SUPPLIER_LIST(
346: asl_id ,
347: using_organization_id ,
511: WHERE pasl.vendor_id = x_vendor_id
512: AND pasl.item_id = x_item_id
513: AND using_organization_id = -1;
514:
515: fnd_file.put_line(fnd_file.log, 'ASL entry already exists.');
516:
517: END IF;
518:
519: EXCEPTION
517: END IF;
518:
519: EXCEPTION
520: WHEN OTHERS THEN
521: fnd_file.put_line(fnd_file.log, '** Exception in create_asl_entry');
522: fnd_file.put_line(fnd_file.log, 'x_progress = '||x_progress);
523: fnd_file.put_line(fnd_file.log,'CREATE_ASL_ENTRY'|| sqlcode);
524: PO_MESSAGE_S.SQL_ERROR('CREATE_ASL_ENTRY', x_progress, sqlcode);
525: END;
518:
519: EXCEPTION
520: WHEN OTHERS THEN
521: fnd_file.put_line(fnd_file.log, '** Exception in create_asl_entry');
522: fnd_file.put_line(fnd_file.log, 'x_progress = '||x_progress);
523: fnd_file.put_line(fnd_file.log,'CREATE_ASL_ENTRY'|| sqlcode);
524: PO_MESSAGE_S.SQL_ERROR('CREATE_ASL_ENTRY', x_progress, sqlcode);
525: END;
526: /*===========================================================================
519: EXCEPTION
520: WHEN OTHERS THEN
521: fnd_file.put_line(fnd_file.log, '** Exception in create_asl_entry');
522: fnd_file.put_line(fnd_file.log, 'x_progress = '||x_progress);
523: fnd_file.put_line(fnd_file.log,'CREATE_ASL_ENTRY'|| sqlcode);
524: PO_MESSAGE_S.SQL_ERROR('CREATE_ASL_ENTRY', x_progress, sqlcode);
525: END;
526: /*===========================================================================
527:
580: WHERE asl_id = x_asl_id;
581:
582: IF (x_request_id IS NULL OR x_request_id <> -99) THEN
583: null;
584: fnd_file.put_line(fnd_file.log, 'Not adding source documents to existing ASL entry.');
585: return;
586: END IF;
587:
588: OPEN C;
615:
616: IF x_dummy_count > 0 THEN
617:
618: null;
619: fnd_file.put_line(fnd_file.log, 'Source document already exists for this this ASL entry.');
620: ELSE
621:
622: -- Sequence number for this document is one above the highest
623: -- sequence number.
630: AND using_organization_id = -1;
631:
632:
633: x_progress := '040';
634: fnd_file.put_line(fnd_file.log, 'Upgrading source document.');
635: fnd_file.put_line(fnd_file.log, 'DOCUMENT_TYPE_CODE = '||x_document_type_code);
636: fnd_file.put_line(fnd_file.log, 'DOCUMENT_ID = '||x_document_header_id);
637:
638: INSERT INTO PO_ASL_DOCUMENTS(
631:
632:
633: x_progress := '040';
634: fnd_file.put_line(fnd_file.log, 'Upgrading source document.');
635: fnd_file.put_line(fnd_file.log, 'DOCUMENT_TYPE_CODE = '||x_document_type_code);
636: fnd_file.put_line(fnd_file.log, 'DOCUMENT_ID = '||x_document_header_id);
637:
638: INSERT INTO PO_ASL_DOCUMENTS(
639: asl_id,
632:
633: x_progress := '040';
634: fnd_file.put_line(fnd_file.log, 'Upgrading source document.');
635: fnd_file.put_line(fnd_file.log, 'DOCUMENT_TYPE_CODE = '||x_document_type_code);
636: fnd_file.put_line(fnd_file.log, 'DOCUMENT_ID = '||x_document_header_id);
637:
638: INSERT INTO PO_ASL_DOCUMENTS(
639: asl_id,
640: using_organization_id,
687: CLOSE C;
688:
689: EXCEPTION
690: WHEN OTHERS THEN
691: fnd_file.put_line(fnd_file.log, '** Exception in upgrade_asl_documents');
692: fnd_file.put_line(fnd_file.log, 'x_progress = '||x_progress);
693: PO_MESSAGE_S.SQL_ERROR('UPGRADE_ASL_DOCUMENTS', x_progress, sqlcode);
694: END;
695:
688:
689: EXCEPTION
690: WHEN OTHERS THEN
691: fnd_file.put_line(fnd_file.log, '** Exception in upgrade_asl_documents');
692: fnd_file.put_line(fnd_file.log, 'x_progress = '||x_progress);
693: PO_MESSAGE_S.SQL_ERROR('UPGRADE_ASL_DOCUMENTS', x_progress, sqlcode);
694: END;
695:
696: