Tables Used
1)PO_REQUISITION_HEADERS_ALL
2)PO_REQUISITION_LINES_ALL
3)PO_REQ_DISTRIBUTIONS_ALL
4)PO_LOOKUP_CODES
5)MTL_SYSTEM_ITEMS_B
6)GL_CODE_COMBINATION
7)PER_PEOPLE_F
SELECT PRHA.SEGMENT1 "REQUISITION_NUMBER",
PLC.DESCRIPTION "REQ_TYPE",
PRHA.AUTHORIZATION_STATUS "REQ_STATUS",
PPF.FULL_NAME "PREPARER",
PRLA.LINE_NUM,
PRLA.PURCHASE_BASIS "TYPE",
MSIB.SEGMENT1 "ITEM",
PRLA.ITEM_DESCRIPTION,
PRLA.UNIT_MEAS_LOOKUP_CODE "UOM",
PRLA.QUANTITY"LINE_QTY",
PRLA.UNIT_PRICE "PRICE",
PRLA.NEED_BY_DATE "NEED-BY",
PRDA.DISTRIBUTION_ID,
PRDA.REQ_LINE_QUANTITY "DISTRIBUTION_LINE_QTY",
GCC.SEGMENT1||'-'||GCC.SEGMENT2||'-'||GCC.SEGMENT3||'-'||GCC.SEGMENT4||'-'||GCC.SEGMENT5 "CHARGE_ACCOUNT"
FROM PO_REQUISITION_HEADERS_ALL PRHA,
PO_REQUISITION_LINES_ALL PRLA,
PO_REQ_DISTRIBUTIONS_ALL PRDA,
PO_LOOKUP_CODES PLC,
MTL_SYSTEM_ITEMS_B MSIB,
GL_CODE_COMBINATIONS GCC,
PER_PEOPLE_F PPF
WHERE PRHA.REQUISITION_HEADER_ID=PRLA.REQUISITION_HEADER_ID
AND PRDA.REQUISITION_LINE_ID=PRLA.REQUISITION_LINE_ID
AND MSIB.INVENTORY_ITEM_ID=PRLA.ITEM_ID
AND GCC.CODE_COMBINATION_ID=PRDA.CODE_COMBINATION_ID
AND PPF.PERSON_ID=PRHA.PREPARER_ID
AND PRHA.ORG_ID=MSIB.ORGANIZATION_ID
AND UPPER(PRHA.TYPE_LOOKUP_CODE)=UPPER(PLC.LOOKUP_CODE)
AND PLC.LOOKUP_TYPE='REQUISITION TYPE'
AND PRHA.SEGMENT1='Enter your Requisition Number'
1)PO_REQUISITION_HEADERS_ALL
2)PO_REQUISITION_LINES_ALL
3)PO_REQ_DISTRIBUTIONS_ALL
4)PO_LOOKUP_CODES
5)MTL_SYSTEM_ITEMS_B
6)GL_CODE_COMBINATION
7)PER_PEOPLE_F
SELECT PRHA.SEGMENT1 "REQUISITION_NUMBER",
PLC.DESCRIPTION "REQ_TYPE",
PRHA.AUTHORIZATION_STATUS "REQ_STATUS",
PPF.FULL_NAME "PREPARER",
PRLA.LINE_NUM,
PRLA.PURCHASE_BASIS "TYPE",
MSIB.SEGMENT1 "ITEM",
PRLA.ITEM_DESCRIPTION,
PRLA.UNIT_MEAS_LOOKUP_CODE "UOM",
PRLA.QUANTITY"LINE_QTY",
PRLA.UNIT_PRICE "PRICE",
PRLA.NEED_BY_DATE "NEED-BY",
PRDA.DISTRIBUTION_ID,
PRDA.REQ_LINE_QUANTITY "DISTRIBUTION_LINE_QTY",
GCC.SEGMENT1||'-'||GCC.SEGMENT2||'-'||GCC.SEGMENT3||'-'||GCC.SEGMENT4||'-'||GCC.SEGMENT5 "CHARGE_ACCOUNT"
FROM PO_REQUISITION_HEADERS_ALL PRHA,
PO_REQUISITION_LINES_ALL PRLA,
PO_REQ_DISTRIBUTIONS_ALL PRDA,
PO_LOOKUP_CODES PLC,
MTL_SYSTEM_ITEMS_B MSIB,
GL_CODE_COMBINATIONS GCC,
PER_PEOPLE_F PPF
WHERE PRHA.REQUISITION_HEADER_ID=PRLA.REQUISITION_HEADER_ID
AND PRDA.REQUISITION_LINE_ID=PRLA.REQUISITION_LINE_ID
AND MSIB.INVENTORY_ITEM_ID=PRLA.ITEM_ID
AND GCC.CODE_COMBINATION_ID=PRDA.CODE_COMBINATION_ID
AND PPF.PERSON_ID=PRHA.PREPARER_ID
AND PRHA.ORG_ID=MSIB.ORGANIZATION_ID
AND UPPER(PRHA.TYPE_LOOKUP_CODE)=UPPER(PLC.LOOKUP_CODE)
AND PLC.LOOKUP_TYPE='REQUISITION TYPE'
AND PRHA.SEGMENT1='Enter your Requisition Number'
This comment has been removed by the author.
ReplyDelete