47: x_item_count NUMBER := 0;
48: BEGIN
49: select count(distinct pol.item_id)
50: into x_item_count 51: from po_headers poh 52: , po_lines pol
53: where poh.po_header_id = pol.po_header_id
54: and ((poh.type_lookup_code = 'QUOTATION' and poh.status_lookup_code = 'A')
55: or (poh.type_lookup_code = 'BLANKET' and poh.approved_flag = 'Y'))