806: and attribute_name=attr_name;
807:
808: if (shipping_level = 0) then
809: select 1 into X_so_ship
810: from oe_order_lines_all l
811: where l.inventory_item_id = p_item_id
812: and l.open_flag = 'Y'
813: and nvl(l.shipping_interfaced_flag,'N') = 'N'
814: and l.ship_from_org_id = p_org_id
814: and l.ship_from_org_id = p_org_id
815: and rownum = 1;
816: else
817: select 1 into X_so_ship
818: from oe_order_lines_all l
819: where l.inventory_item_id = p_item_id
820: and l.open_flag = 'Y'
821: and nvl(l.shipping_interfaced_flag,'N') = 'N'
822: and l.ship_from_org_id in
869: END IF;
870: -- Bug 4139938 end
871:
872: /* Bug 1923215
873: Modified the below SQL to use the oe_order_lines_all Table
874: as so_lines_all and so_line_details are obsoleted in R11i
875: */
876: -- Check for open sales order line with a different value for
877: -- so_transactions_flag than in mtl_system_items
881: attr_name := 'MTL_SYSTEM_ITEMS.SO_TRANSACTIONS_FLAG';
882: IF X_so_txn IS NOT NULL THEN
883: select count(1)
884: into X_so_txn
885: from oe_order_lines_all l
886: where l.inventory_item_id = p_item_id
887: and l.open_flag || '' = 'Y'
888: and (l.ship_from_org_id in
889: (select organization_id
901: -- Check for open sales order line for the item
902: IF X_so_open_exists IS NOT NULL THEN
903: select count(*) into X_so_open_exists from dual
904: where exists
905: ( select * from oe_order_lines_all
906: where inventory_item_id = p_item_id
907: and open_flag || '' = 'Y' );
908: END IF;
909:
920:
921: /*
922: select count(1)
923: into X_demand_exists
924: from oe_order_lines_all
925: where inventory_item_id = p_item_id
926: and visible_demand_flag = 'Y'
927: and shipped_quantity is NOT null
928: and (ship_from_org_id in