[Home] [Help]
526: and c.column_name = d.column_name
527: and nvl(c.is_printable_flag, 'N') = 'Y'
528: and nvl(c.ignore_source_flag, 'N') = 'N'
529:
530: and not exists(SELECT 1 from po_entity_rollup_gt
531: WHERE document_type = d.document_type
532: and entity_name = d.entity_name
533: and mod_doc_source_name = d.mod_doc_source_name
534: and column_name = d.column_name
564: base_pk3_value NUMBER default null,
565: base_pk4_value NUMBER default null,
566: base_pk5_value NUMBER default null ) RETURN XMLType IS
567:
568: --cursor which gets the rollup change by grouping rows in po_entity_rollup_gt table
569: CURSOR c_rollup_changes IS
570: SELECT d.mod_doc_source_name,
571: d.column_name,
572: nvl(fnd_message.get_string('PON', min(c.label_message_code)),d.column_name) label_message_code,
580: nvl(min(d.mod_value_desc), d.mod_value)) mod_value_desc,
581: min(c.disp_data_type) disp_data_type,
582: min(c.sub_entity_name) sub_entity_name
583:
584: FROM po_entity_rollup_gt d,
585: po_diff_config c
586:
587: WHERE d.document_type = p_document_type
588: and d.entity_name = p_entity_name
606: FROM (SELECT line_num_display line, line_num_display -row_number() over(order by to_number(line_num_display)) rn, group_line_id
607: FROM pon_auction_item_prices_all
608: WHERE group_line_id is null
609: and auction_header_id = mod_pk1_value
610: and line_number IN (select mod_doc_pk2_val FROM po_entity_rollup_gt d
611: WHERE d.document_type = p_document_type
612: and d.entity_name = p_entity_name
613: and d.mod_doc_pk1_val = mod_pk1_value
614: and mod_doc_source_name = c_mod_doc_source
631: ) base
632: WHERE mod.line_number = base.line_number
633: and mod.group_line_id is not null
634: and mod.auction_header_id = mod_pk1_value
635: and mod.line_number IN (SELECT mod_doc_pk2_val FROM po_entity_rollup_gt d
636: WHERE d.document_type = p_document_type
637: and d.entity_name = p_entity_name
638: and d.mod_doc_pk1_val = mod_pk1_value
639: and mod_doc_source_name = c_mod_doc_source
874: group by '|| l_groupby_stmt ||' HAVING count(*) > 1 ';
875:
876:
877: --sql stmt to get the rollup changes rows and populating it to the gt table
878: l_insert_stmt := 'INSERT INTO po_entity_rollup_gt (
879: document_type, entity_name, mod_doc_source_name, base_doc_pk1_val, base_doc_pk2_val,
880: base_doc_pk3_val, base_doc_pk4_val, base_doc_pk5_val, mod_doc_pk1_val, mod_doc_pk2_val,
881: mod_doc_pk3_val, mod_doc_pk4_val, mod_doc_pk5_val, column_name, mod_value, orig_value,
882: mod_value_desc, orig_value_desc, creation_date, created_by, last_update_date, last_updated_by)