107: NEW_DELIVER_TO_LOC_LIST DELIVER_TO_LOC_ID_LIST_TYPE; --Bug 4009128
108:
109: BEGIN
110:
111: arp_message.set_line( 'POP_CMERGE_REQ.PO_RL()+' );
112:
113: /*-----------------------------+
114: | PO_REQUISITION_LINES |
115: +-----------------------------*/
117: IF (process_mode = 'LOCK') then
118:
119: /* try to lock the table first */
120:
121: arp_message.set_name( 'AR', 'AR_LOCKING_TABLE');
122: arp_message.set_token( 'TABLE_NAME', 'PO_REQUISITION_LINES', FALSE );
123: arp_message.flush;
124:
125: OPEN C1;
118:
119: /* try to lock the table first */
120:
121: arp_message.set_name( 'AR', 'AR_LOCKING_TABLE');
122: arp_message.set_token( 'TABLE_NAME', 'PO_REQUISITION_LINES', FALSE );
123: arp_message.flush;
124:
125: OPEN C1;
126: CLOSE C1;
119: /* try to lock the table first */
120:
121: arp_message.set_name( 'AR', 'AR_LOCKING_TABLE');
122: arp_message.set_token( 'TABLE_NAME', 'PO_REQUISITION_LINES', FALSE );
123: arp_message.flush;
124:
125: OPEN C1;
126: CLOSE C1;
127:
128: ELSE
129:
130: /* Modify locations for those lines for which locations are going to change */
131:
132: arp_message.set_name('AR', 'AR_UPDATING_TABLE');
133: arp_message.set_token('TABLE_NAME', 'PO_REQUISITION_LINES', FALSE);
134: arp_message.set_line('Merging locations for merged customers/sites.');
135:
136: /* Bug 2447478 START */
129:
130: /* Modify locations for those lines for which locations are going to change */
131:
132: arp_message.set_name('AR', 'AR_UPDATING_TABLE');
133: arp_message.set_token('TABLE_NAME', 'PO_REQUISITION_LINES', FALSE);
134: arp_message.set_line('Merging locations for merged customers/sites.');
135:
136: /* Bug 2447478 START */
137: HZ_ACCT_MERGE_UTIL.load_set(set_num, req_id);
130: /* Modify locations for those lines for which locations are going to change */
131:
132: arp_message.set_name('AR', 'AR_UPDATING_TABLE');
133: arp_message.set_token('TABLE_NAME', 'PO_REQUISITION_LINES', FALSE);
134: arp_message.set_line('Merging locations for merged customers/sites.');
135:
136: /* Bug 2447478 START */
137: HZ_ACCT_MERGE_UTIL.load_set(set_num, req_id);
138: l_profile_val := FND_PROFILE.VALUE('HZ_AUDIT_ACCT_MERGE');
269: close merged_records;
270: /* Bug 2447478 END */
271:
272: /* Number of rows updates */
273: arp_message.set_name('AR', 'AR_ROWS_UPDATED');
274: arp_message.set_token('NUM_ROWS',to_char(g_count));
275:
276: END IF;
277:
270: /* Bug 2447478 END */
271:
272: /* Number of rows updates */
273: arp_message.set_name('AR', 'AR_ROWS_UPDATED');
274: arp_message.set_token('NUM_ROWS',to_char(g_count));
275:
276: END IF;
277:
278: arp_message.set_line( 'POP_CMERGE_REQ.PO_RL()-' );
274: arp_message.set_token('NUM_ROWS',to_char(g_count));
275:
276: END IF;
277:
278: arp_message.set_line( 'POP_CMERGE_REQ.PO_RL()-' );
279:
280:
281: EXCEPTION
282: when others then
279:
280:
281: EXCEPTION
282: when others then
283: arp_message.set_error( 'POP_CMERGE_REQ.PO_RL');
284: raise;
285:
286: END;
287:
550: /* Bug 2447478 END */
551:
552: BEGIN
553:
554: arp_message.set_line( 'POP_CMERGE_REQ.PO_LA()+' );
555:
556: /*-----------------------------+
557: | PO_LOCATION_ASSOCIATIONS |
558: +-----------------------------*/
560: IF (process_mode = 'LOCK') then
561:
562: /* try to lock the table first */
563:
564: arp_message.set_name( 'AR', 'AR_LOCKING_TABLE');
565: arp_message.set_token( 'TABLE_NAME', 'PO_LOCATION_ASSOCIATIONS', FALSE );
566: arp_message.flush;
567:
568: OPEN C1;
561:
562: /* try to lock the table first */
563:
564: arp_message.set_name( 'AR', 'AR_LOCKING_TABLE');
565: arp_message.set_token( 'TABLE_NAME', 'PO_LOCATION_ASSOCIATIONS', FALSE );
566: arp_message.flush;
567:
568: OPEN C1;
569: CLOSE C1;
562: /* try to lock the table first */
563:
564: arp_message.set_name( 'AR', 'AR_LOCKING_TABLE');
565: arp_message.set_token( 'TABLE_NAME', 'PO_LOCATION_ASSOCIATIONS', FALSE );
566: arp_message.flush;
567:
568: OPEN C1;
569: CLOSE C1;
570:
571: ELSE
572:
573: /* for merged customers/sites */
574:
575: arp_message.set_name('AR', 'AR_UPDATING_TABLE');
576: arp_message.set_token('TABLE_NAME', 'PO_LOCATION_ASSOCIATIONS', FALSE);
577: arp_message.set_line('Deleting merged customers/sites.');
578:
579: /* Bug 2447478 START */
572:
573: /* for merged customers/sites */
574:
575: arp_message.set_name('AR', 'AR_UPDATING_TABLE');
576: arp_message.set_token('TABLE_NAME', 'PO_LOCATION_ASSOCIATIONS', FALSE);
577: arp_message.set_line('Deleting merged customers/sites.');
578:
579: /* Bug 2447478 START */
580: g_count := 0;
573: /* for merged customers/sites */
574:
575: arp_message.set_name('AR', 'AR_UPDATING_TABLE');
576: arp_message.set_token('TABLE_NAME', 'PO_LOCATION_ASSOCIATIONS', FALSE);
577: arp_message.set_line('Deleting merged customers/sites.');
578:
579: /* Bug 2447478 START */
580: g_count := 0;
581: HZ_ACCT_MERGE_UTIL.load_set(set_num, req_id);
739:
740: /* Bug 2447478 END */
741:
742: /* Number of rows updates */
743: arp_message.set_name('AR', 'AR_ROWS_UPDATED');
744: arp_message.set_token('NUM_ROWS', to_char(g_count)); -- Bug 2447478
745:
746:
747: /* for changed customers */
740: /* Bug 2447478 END */
741:
742: /* Number of rows updates */
743: arp_message.set_name('AR', 'AR_ROWS_UPDATED');
744: arp_message.set_token('NUM_ROWS', to_char(g_count)); -- Bug 2447478
745:
746:
747: /* for changed customers */
748:
745:
746:
747: /* for changed customers */
748:
749: arp_message.set_name('AR', 'AR_UPDATING_TABLE');
750: arp_message.set_token('TABLE_NAME', 'PO_LOCATION_ASSOCIATIONS', FALSE);
751: arp_message.set_line('Updating changed customers.');
752:
753: /* Bug 2447478 START */
746:
747: /* for changed customers */
748:
749: arp_message.set_name('AR', 'AR_UPDATING_TABLE');
750: arp_message.set_token('TABLE_NAME', 'PO_LOCATION_ASSOCIATIONS', FALSE);
751: arp_message.set_line('Updating changed customers.');
752:
753: /* Bug 2447478 START */
754: g_count := 0;
747: /* for changed customers */
748:
749: arp_message.set_name('AR', 'AR_UPDATING_TABLE');
750: arp_message.set_token('TABLE_NAME', 'PO_LOCATION_ASSOCIATIONS', FALSE);
751: arp_message.set_line('Updating changed customers.');
752:
753: /* Bug 2447478 START */
754: g_count := 0;
755:
889:
890: /* Bug 2447478 END */
891:
892: /* Number of rows updates */
893: arp_message.set_name('AR', 'AR_ROWS_UPDATED');
894: arp_message.set_token('NUM_ROWS', to_char(g_count)); -- Bug 2447478
895:
896: END IF;
897:
890: /* Bug 2447478 END */
891:
892: /* Number of rows updates */
893: arp_message.set_name('AR', 'AR_ROWS_UPDATED');
894: arp_message.set_token('NUM_ROWS', to_char(g_count)); -- Bug 2447478
895:
896: END IF;
897:
898: arp_message.set_line( 'POP_CMERGE_REQ.PO_LA()-' );
894: arp_message.set_token('NUM_ROWS', to_char(g_count)); -- Bug 2447478
895:
896: END IF;
897:
898: arp_message.set_line( 'POP_CMERGE_REQ.PO_LA()-' );
899:
900:
901: EXCEPTION
902: when others then
899:
900:
901: EXCEPTION
902: when others then
903: arp_message.set_error( 'POP_CMERGE_REQ.PO_LA');
904: raise;
905: END;
906:
907:
909:
910: PROCEDURE MERGE (req_id NUMBER, set_num NUMBER, process_mode VARCHAR2) is
911: BEGIN
912:
913: arp_message.set_line( 'POP_CMERGE_REQ.MERGE()+' );
914:
915: PO_RL( req_id, set_num, process_mode );
916: PO_LA( req_id, set_num, process_mode );
917:
914:
915: PO_RL( req_id, set_num, process_mode );
916: PO_LA( req_id, set_num, process_mode );
917:
918: arp_message.set_line( 'POP_CMERGE_REQ.MERGE()-' );
919:
920: END MERGE;
921: end POP_CMERGE_REQ;