DBA Data[Home] [Help]

VIEW: APPS.SO_SERVICE_DETAILS

Source

View Text - Preformatted

SELECT l.line_id line_id, decode(l.parent_line_id,'','' ,l.line_number) option_line_number, l.parent_line_id parent_line_id, l.component_code component_code, l.inventory_item_id inventory_item_id, l.ordered_quantity quantity, msi.description description, 0 row_level, l.line_id id_column from so_lines l, mtl_system_items msi WHERE msi.inventory_item_id = l.inventory_item_id and msi.organization_id = FND_PROFILE.VALUE('SO_ORGANIZATION_ID' ) UNION select l.line_id line_id, decode(l.parent_line_id,'','' ,l.line_number) option_line_number, l.parent_line_id parent_line_id, l.component_code component_code, l.inventory_item_id inventory_item_id, lsd.customer_product_quantity quantity, '  ' || s.name ||' '|| cp.current_serial_number || ' ' || cp.current_cp_revision_id description, 4 row_level, line_service_detail_id id_column from so_lines l, so_line_service_details lsd, cs_systems s, cs_customer_products cp where nvl(l.s25,18) != 14 and lsd.line_id = l.line_id and lsd.system_id = s.system_id(+) and lsd.customer_product_id = cp.customer_product_id(+) and l.line_id in (select line_id from so_line_service_details ld2 where ld2.line_id = l.line_id group by ld2.line_id having count(*) > 1) UNION select l.line_id line_id, decode(l.parent_line_id,'','' ,l.line_number) option_line_number, l.parent_line_id parent_line_id, l.component_code component_code, l.inventory_item_id inventory_item_id, cp.quantity quantity, '  ' || s.name ||' ' || r.serial_number || ' ' || r.revision description, 5 row_level, r.cp_revision_id id_column from so_lines l, cs_cp_revisions r, cs_customer_products cp, cs_customer_product_statuses cps, cs_systems s where nvl(l.s25,18) = 14 and l.line_id = cp.original_order_line_id and l.line_id = r.order_line_id and cp.customer_product_id = r.customer_product_id and cp.customer_product_status_id = cps.customer_product_status_id and cps.cancelled_flag = 'N' and cp.system_id = s.system_id and l.line_id in (select r2.order_line_id from cs_cp_revisions r2, cs_customer_products cp2, cs_customer_product_statuses cps2 where l.line_id = cp.original_order_line_id and l.line_id = r2.order_line_id and cp2.customer_product_id = r2.customer_product_id and cp2.customer_product_status_id = cps2.customer_product_status_id and cps2.cancelled_flag = 'N' group by r2.order_line_id having count(*) > 1)
View Text - HTML Formatted

SELECT L.LINE_ID LINE_ID
, DECODE(L.PARENT_LINE_ID
, ''
, ''
, L.LINE_NUMBER) OPTION_LINE_NUMBER
, L.PARENT_LINE_ID PARENT_LINE_ID
, L.COMPONENT_CODE COMPONENT_CODE
, L.INVENTORY_ITEM_ID INVENTORY_ITEM_ID
, L.ORDERED_QUANTITY QUANTITY
, MSI.DESCRIPTION DESCRIPTION
, 0 ROW_LEVEL
, L.LINE_ID ID_COLUMN
FROM SO_LINES L
, MTL_SYSTEM_ITEMS MSI
WHERE MSI.INVENTORY_ITEM_ID = L.INVENTORY_ITEM_ID
AND MSI.ORGANIZATION_ID = FND_PROFILE.VALUE('SO_ORGANIZATION_ID' ) UNION SELECT L.LINE_ID LINE_ID
, DECODE(L.PARENT_LINE_ID
, ''
, ''
, L.LINE_NUMBER) OPTION_LINE_NUMBER
, L.PARENT_LINE_ID PARENT_LINE_ID
, L.COMPONENT_CODE COMPONENT_CODE
, L.INVENTORY_ITEM_ID INVENTORY_ITEM_ID
, LSD.CUSTOMER_PRODUCT_QUANTITY QUANTITY
, ' ' || S.NAME ||' '|| CP.CURRENT_SERIAL_NUMBER || ' ' || CP.CURRENT_CP_REVISION_ID DESCRIPTION
, 4 ROW_LEVEL
, LINE_SERVICE_DETAIL_ID ID_COLUMN
FROM SO_LINES L
, SO_LINE_SERVICE_DETAILS LSD
, CS_SYSTEMS S
, CS_CUSTOMER_PRODUCTS CP
WHERE NVL(L.S25
, 18) != 14
AND LSD.LINE_ID = L.LINE_ID
AND LSD.SYSTEM_ID = S.SYSTEM_ID(+)
AND LSD.CUSTOMER_PRODUCT_ID = CP.CUSTOMER_PRODUCT_ID(+)
AND L.LINE_ID IN (SELECT LINE_ID
FROM SO_LINE_SERVICE_DETAILS LD2
WHERE LD2.LINE_ID = L.LINE_ID GROUP BY LD2.LINE_ID HAVING COUNT(*) > 1) UNION SELECT L.LINE_ID LINE_ID
, DECODE(L.PARENT_LINE_ID
, ''
, ''
, L.LINE_NUMBER) OPTION_LINE_NUMBER
, L.PARENT_LINE_ID PARENT_LINE_ID
, L.COMPONENT_CODE COMPONENT_CODE
, L.INVENTORY_ITEM_ID INVENTORY_ITEM_ID
, CP.QUANTITY QUANTITY
, ' ' || S.NAME ||' ' || R.SERIAL_NUMBER || ' ' || R.REVISION DESCRIPTION
, 5 ROW_LEVEL
, R.CP_REVISION_ID ID_COLUMN
FROM SO_LINES L
, CS_CP_REVISIONS R
, CS_CUSTOMER_PRODUCTS CP
, CS_CUSTOMER_PRODUCT_STATUSES CPS
, CS_SYSTEMS S
WHERE NVL(L.S25
, 18) = 14
AND L.LINE_ID = CP.ORIGINAL_ORDER_LINE_ID
AND L.LINE_ID = R.ORDER_LINE_ID
AND CP.CUSTOMER_PRODUCT_ID = R.CUSTOMER_PRODUCT_ID
AND CP.CUSTOMER_PRODUCT_STATUS_ID = CPS.CUSTOMER_PRODUCT_STATUS_ID
AND CPS.CANCELLED_FLAG = 'N'
AND CP.SYSTEM_ID = S.SYSTEM_ID
AND L.LINE_ID IN (SELECT R2.ORDER_LINE_ID
FROM CS_CP_REVISIONS R2
, CS_CUSTOMER_PRODUCTS CP2
, CS_CUSTOMER_PRODUCT_STATUSES CPS2
WHERE L.LINE_ID = CP.ORIGINAL_ORDER_LINE_ID
AND L.LINE_ID = R2.ORDER_LINE_ID
AND CP2.CUSTOMER_PRODUCT_ID = R2.CUSTOMER_PRODUCT_ID
AND CP2.CUSTOMER_PRODUCT_STATUS_ID = CPS2.CUSTOMER_PRODUCT_STATUS_ID
AND CPS2.CANCELLED_FLAG = 'N' GROUP BY R2.ORDER_LINE_ID HAVING COUNT(*) > 1)