Sunday 8 January 2017

BOM ROUTING RESOURCES & OPERATION

BOM OPERATION ROUTING


SELECT
--bor.routing_sequence_id ,
bos.operation_sequence_id op_seq_id ,
bos.operation_seq_num op_seq ,
bos.operation_description ,
--bos.standard_operation_id ,
bos.department_id ,
bos.operation_type ,
bor.routing_type ,
bso.operation_code operation_code,
bor.completion_subinventory comp_subinv,
bor.completion_locator_id comp_loc ,
bd.department_code department_code
FROM
bom_standard_operations bso,
bom_departments bd,
bom_operation_sequences bos,
bom_operational_routings bor
WHEREe bor.assembly_item_id = 149
AND bor.organization_id =207
AND bor.routing_sequence_id=bos.routing_sequence_id
AND bos.department_id = bd.department_id
AND bos.standard_operation_id = bso.standard_operation_id (+)
ORDER BY bos.operation_sequence_id
/


BOM ROUTING RESOURCES

SELECT
bor.routing_sequence_id ,
bos.operation_sequence_id op_seq_id,
bos.operation_seq_num op_seq,
bso.operation_code op_code,
bos.operation_description ,
bos.standard_operation_id std_op_id,
bos.department_id dept,
bos.operation_type op_type,
boc.resource_seq_num res_seq,
boc.resource_id ,
boc.activity_id ,
boc.basis_type basis,
br.resource_code res_code,
bor.completion_subinventory comp_subinv,
bor.completion_locator_id comp_loc,
bor.routing_type rout_type,
boc.usage_rate_or_amount rate
FROM
bom_standard_operations bso,
bom_resources br,
bom_operation_resources boc,
bom_operation_sequences bos,
bom_operational_routings bor
WHERE
bor.assembly_item_id = 149
AND bor.organization_id =207
AND bor.routing_sequence_id=bos.routing_sequence_id
AND bos.operation_sequence_id=boc.operation_sequence_id
AND br.resource_id = boc.resource_id
AND bos.standard_operation_id = bso.standard_operation_id (+)
ORDER BY 1
/
FIND ATTACHMENTS FOR BOM 


SELECT to_number(AD.PK1_VALUE) operation_sequence_id,
TL.DESCRIPTION instruction_code,
ST.SHORT_TEXT instruction_description
FROM FND_DOCUMENTS D,
FND_DOCUMENTS_TL TL,
FND_DOCUMENTS_SHORT_TEXT ST,
FND_ATTACHED_DOCUMENTS AD,
bom_operation_sequences bos
WHERE bos.operation_sequence_id =166
and bos.operation_sequence_id = to_number(AD.PK1_VALUE)
AND D.DOCUMENT_ID = TL.DOCUMENT_ID
AND TL.DOCUMENT_ID = AD.DOCUMENT_ID
AND TL.MEDIA_ID = ST.MEDIA_ID
AND SYSDATE BETWEEN TRUNC(NVL(D.START_DATE_ACTIVE, SYSDATE))
AND TRUNC(NVL(D.END_DATE_ACTIVE, SYSDATE))+1
AND AD.ENTITY_NAME like 'BOM_OPERATION_SEQUENCES'
AND TL.LANGUAGE = userenv('LANG')
ORDER BY instruction_code

No comments :