REM RMA Receipts Details
SELECT DHA.SOURCE_ORDER_NUMBER
, HDR_LKP.MEANING ORDER_TYPE
, DFLA.SOURCE_LINE_NUMBER
, LINE_LKP.MEANING LINE_TYPE
, INV.ORGANIZATION_CODE
, DSV.DISPLAY_NAME FUL_LINE_STATUS
, (SELECT TO_CHAR(CREATION_DATE, 'DD-MON-YYYY') FROM INV_MATERIAL_TXNS WHERE RCV_TRANSACTION_ID = RMA_RECEIPT_TRANSACTION_ID) INV_TXN_CREATION_DATE
, ESIB.ITEM_NUMBER
, DLA.ORDERED_QTY LINE_ORDERED_QTY
, DFLA.ORDERED_QTY FULFILL_LINE_ORDERED_QTY
, DFLA.RMA_DELIVERED_QTY
, DFLD.RMA_RECEIPT_NUMBER
, DFLD.RMA_RECEIPT_LINE_NUMBER
, DFLD.RMA_RECEIPT_DATE
, DLA.DISPLAY_LINE_NUMBER
|| '.'
|| DFLA.FULFILL_LINE_NUMBER LINE_NUM
FROM FUSION.INV_ORG_PARAMETERS INV
, FUSION.DOO_FULFILL_LINES_ALL DFLA
, FUSION.DOO_FULFILL_LINE_DETAILS DFLD
, FUSION.FND_LOOKUP_VALUES_VL LINE_LKP
, FUSION.DOO_LINES_ALL DLA
, FUSION.FND_LOOKUP_VALUES_VL HDR_LKP
, FUSION.DOO_HEADERS_ALL DHA
, FUSION.EGP_SYSTEM_ITEMS_B ESIB
, FUSION.DOO_STATUSES_VL DSV
, FUSION.DOO_ORCHESTRATION_APPLICATIONS DOA
WHERE DHA.HEADER_ID = DFLA.HEADER_ID
AND DHA.HEADER_ID = DLA.HEADER_ID
AND DFLA.LINE_ID = DLA.LINE_ID
AND DHA.SUBMITTED_FLAG = 'Y'
AND DHA.ORDER_TYPE_CODE = HDR_LKP.LOOKUP_CODE
AND HDR_LKP.LOOKUP_TYPE = 'ORA_DOO_ORDER_TYPES'
AND HDR_LKP.ENABLED_FLAG = 'Y'
AND DFLA.LINE_TYPE_CODE = LINE_LKP.LOOKUP_CODE
AND LINE_LKP.LOOKUP_TYPE IN ('ORA_DOO_LINE_TYPES', 'ORA_DOO_RETURN_LINE_TYPES')
AND LINE_LKP.ENABLED_FLAG = 'Y'
AND DOA.ORCHESTRATION_APPLICATION_CODE = 'DOO'
AND DOA.ORCHESTRATION_APPLICATION_ID = DSV.ORCHESTRATION_APPLICATION_ID
AND DFLA.STATUS_CODE = DSV.STATUS_CODE
AND DLA.INVENTORY_ITEM_ID = ESIB.INVENTORY_ITEM_ID
AND DLA.INVENTORY_ORGANIZATION_ID = ESIB.ORGANIZATION_ID
AND DFLA.FULFILL_ORG_ID = INV.ORGANIZATION_ID
AND UPPER(DFLD.TASK_TYPE(+)) = 'RETURN'
AND DFLA.FULFILL_LINE_ID = DFLD.FULFILL_LINE_ID(+)
AND DHA.SOURCE_ORDER_NUMBER = :P_ORDER_NUMBER
--AND ESIB.ITEM_NUMBER = NVL(:P_ITEM_NUMBER, ESIB.ITEM_NUMBER)
ORDER BY DHA.SOURCE_ORDER_NUMBER, LPAD(DLA.DISPLAY_LINE_NUMBER, 2) ASC;
Tuesday, July 6, 2021
FA:RCV:SQL to get RMA Receipts Details in Oracle Fusion
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment
Note: Only a member of this blog may post a comment.