Thursday, August 4, 2011

WIP Queries

FIND JOB ATTACHMENTS IN WIP
SELECT WOI.ORGANIZATION_ID,
WOI.WIP_ENTITY_ID,
WOI.OPERATION_SEQ_NUM,
WOI.OPERATION_DESCRIPTION_CODE Instruction,
FDST.SHORT_TEXT Instruction_Description
FROM WIP_OPERATION_INSTRUCTIONS_V WOI,
FND_DOCUMENTS_VL FDVL,
FND_DOCUMENTS_SHORT_TEXT FDST,
WIP_ENTITIES WE
WHERE WE.WIP_ENTITY_ID = ''
AND WE.ORGANIZATION_ID = ''AND FDVL.SECURITY_ID = WOI.ORGANIZATION_ID
AND WOI.WIP_ENTITY_ID = WE.WIP_ENTITY_ID
AND FDVL.DOCUMENT_ID = WOI.DOCUMENT_ID
AND FDST.MEDIA_ID = FDVL.MEDIA_ID
AND FDVL.DATATYPE_ID= ''
ORDER BY WOI.OPERATION_SEQ_NUM, WOI.OPERATION_DESCRIPTION_CODE
/

JOB WITH SO IN WIP
SELECT DJ.WIP_ENTITY_ID WIP_Entity_ID,
MS.SEGMENT1
'.'
MS.SEGMENT2
'.'
MS.SEGMENT3 C_Sales_Order_Data,
SO.USER_LINE_NUM CI_Line,
SO.USER_DELIVERY User_Delivery,
SO.DEMAND_CLASS SO_Demand_Class,
SO.QUANTITY_ALLOCATED Allocated,
SO.QUANTITY_COMPLETED Qty_Completed
FROM MTL_SALES_ORDERS MS,
WIP_DISCRETE_JOBS DJ,
WIP_SO_ALLOCATIONS SO,
WIP_ENTITIES WE
WHERE SO.WIP_ENTITY_ID = 31649
AND SO.ORGANIZATION_ID = 207
AND DJ.ORGANIZATION_ID = 207
AND DJ.WIP_ENTITY_ID = SO.WIP_ENTITY_ID
AND DJ.WIP_ENTITY_ID = WE.WIP_ENTITY_ID
AND MS.SALES_ORDER_ID = SO.DEMAND_SOURCE_HEADER_ID
ORDER BY SO.USER_LINE_NUM
/

JOB RESERVATIONS IN WIP
SELECT DJ.WIP_ENTITY_ID WIP_Entity_ID,
WRV.DEMAND_SOURCE_LINE_NUMBER CR_Line,
WRV.DEMAND_CLASS_CODE Reservation_Demand_Class,
WRV.PRIMARY_QUANTITY Reserved_Primary_Qty,
WRV.PRIMARY_UOM_CODE Reserved_Primary_UOM,
WRV.RESERVED_LINE_UOM_QUANTITY Reserved_Line_Qty,
WRV.ORDER_LINE_UOM_CODE Reserved_Line_UOM
FROM MTL_SALES_ORDERS MS,
WIP_DISCRETE_JOBS DJ,
WIP_RESERVATIONS_V WRV,
WIP_ENTITIES WE
WHERE WRV.WIP_ENTITY_ID = 31649
AND WRV.ORGANIZATION_ID = 207
AND DJ.ORGANIZATION_ID = 207
AND DJ.WIP_ENTITY_ID = WRV.WIP_ENTITY_ID
AND DJ.WIP_ENTITY_ID = WE.WIP_ENTITY_ID
AND MS.SALES_ORDER_ID = WRV.DEMAND_SOURCE_HEADER_ID
ORDER BY WRV.DEMAND_SOURCE_LINE_NUMBER
/

No comments:

Post a Comment

Best Blogger TipsGet Flower Effect