274: AND item_id = V_item_id;
275: END IF;
276:
277: IF (INSTR(V_whse_list,',') <> 0) THEN
278: X_whse_code := FND_PROFILE.VALUE('SY$ALL');
279: ELSE
280: X_whse_code := REPLACE(V_whse_list, '''', '');
281: END IF;
282:
701: ' and mtl.demand_id = dtl.line_id '||
702: ' and dtl.header_id = hdr.header_id '||
703: ' and dtl.ship_from_org_id = org.organization_id '||
704: ' and org.process_enabled_flag = '|| '''Y''' ||
705: /* ' and ((TO_NUMBER(FND_PROFILE.VALUE(''GMP_EXCLUDE_INTERNAL_OMSO'')) = 1 ' ||
706: ' and nvl(dtl.source_document_type_id, 0) <> 10 ' ||
707: ' ) ' ||
708: ' or TO_NUMBER(FND_PROFILE.VALUE(''GMP_EXCLUDE_INTERNAL_OMSO'')) = 0 ' ||
709: ' ) ' ||
704: ' and org.process_enabled_flag = '|| '''Y''' ||
705: /* ' and ((TO_NUMBER(FND_PROFILE.VALUE(''GMP_EXCLUDE_INTERNAL_OMSO'')) = 1 ' ||
706: ' and nvl(dtl.source_document_type_id, 0) <> 10 ' ||
707: ' ) ' ||
708: ' or TO_NUMBER(FND_PROFILE.VALUE(''GMP_EXCLUDE_INTERNAL_OMSO'')) = 0 ' ||
709: ' ) ' ||
710: */
711: ' and NOT EXISTS '||
712: ' (SELECT 1 '||
1175: WHERE matl_rep_id = V_matl_rep_id
1176: AND item_id = V_item_id;
1177: END IF;
1178: IF (INSTR(V_org_list,',') <> 0) THEN
1179: -- X_whse_code := FND_PROFILE.VALUE('SY$ALL');
1180: X_organization_id := NULL;
1181: ELSE /* For reports the V_org_list will be single org */
1182: X_organization_id := TO_NUMBER(V_org_list);
1183: -- X_whse_code := REPLACE(V_org_list, '''', '');