QUERY TO EXTRACT TO PURCHASE ORDERS DATA
select
pha.SEGMENT1
, pha.ATTRIBUTE9 LEGACY_PO
, pha.COMMENTS Description
, pha.CREATION_DATE
, aps.SEGMENT1 VENDOR_NUM
, aps.VENDOR_NAME
, hlv.LOCATION_CODE SHIP_TO
, hlv.LOCATION_CODE BILL_TO
, pha.CURRENCY_CODE
, pha.RATE_TYPE
, pha.RATE_DATE
, pha.RATE
, papf.full_name
, pla.LINE_NUM
, msik.CONCATENATED_SEGMENTS ITEM
, msik.ATTRIBUTE1 ban_code
, msik.ITEM_TYPE
, pla.UNIT_MEAS_LOOKUP_CODE
, pla.QUANTITY
, pla.UNIT_PRICE
, plla.NEED_BY_DATE
, ppa.SEGMENT1 PROJECT
, ptv.TASK_NUMBER
, pda.EXPENDITURE_TYPE
, pda.EXPENDITURE_ITEM_DATE
, haou.NAME EXPENDITURE_ORG
, gcck.CONCATENATED_SEGMENTS CHARGE_ACCOUNT
, papf2.FULL_NAME PR_UNIT_HEAD
, haou2.NAME DEPARTMENT
, pha.ATTRIBUTE14 DEPARTMENT_HEADER
from
PO_HEADERS_All pha
, AP_SUPPLIERS aps
, HR_LOCATIONS_V hlv
, HR_LOCATIONS_V hlv2
, per_all_people_f papf
, po_lines_all pla
, mtl_system_items_kfv msik
, PA_PROJECTS_ALL ppa
, pa_tasks_v ptv
, po_distributions_all pda
, hr_all_organization_units haou
, gl_code_combinations_kfv gcck
, per_all_people_f papf2
, hr_all_organization_units haou2
, po_line_locations_all plla
where
pha.VENDOR_ID =aps.VENDOR_ID
and pha.SHIP_TO_LOCATION_ID = hlv.LOCATION_ID
and pha.BILL_TO_LOCATION_ID = hlv2.LOCATION_ID
and pha.AGENT_ID = papf.PERSON_ID
and pha.PO_HEADER_ID = pla.PO_HEADER_ID
and pla.ITEM_ID = msik.INVENTORY_ITEM_ID
and pla.PROJECT_ID = ppa.PROJECT_ID (+)
and pla.TASK_ID = ptv.TASK_ID (+)
and pla.PO_LINE_ID = pda.PO_LINE_ID
and pda.EXPENDITURE_ORGANIZATION_ID = haou.ORGANIZATION_ID (+)
and pda.PO_DISTRIBUTION_ID = gcck.CODE_COMBINATION_ID
and pha.ATTRIBUTE1 = papf2.PERSON_ID (+)
and pha.ATTRIBUTE3 = haou2.ORGANIZATION_ID (+)
and pla.PO_LINE_ID = plla.PO_LINE_ID
pha.SEGMENT1
, pha.ATTRIBUTE9 LEGACY_PO
, pha.COMMENTS Description
, pha.CREATION_DATE
, aps.SEGMENT1 VENDOR_NUM
, aps.VENDOR_NAME
, hlv.LOCATION_CODE SHIP_TO
, hlv.LOCATION_CODE BILL_TO
, pha.CURRENCY_CODE
, pha.RATE_TYPE
, pha.RATE_DATE
, pha.RATE
, papf.full_name
, pla.LINE_NUM
, msik.CONCATENATED_SEGMENTS ITEM
, msik.ATTRIBUTE1 ban_code
, msik.ITEM_TYPE
, pla.UNIT_MEAS_LOOKUP_CODE
, pla.QUANTITY
, pla.UNIT_PRICE
, plla.NEED_BY_DATE
, ppa.SEGMENT1 PROJECT
, ptv.TASK_NUMBER
, pda.EXPENDITURE_TYPE
, pda.EXPENDITURE_ITEM_DATE
, haou.NAME EXPENDITURE_ORG
, gcck.CONCATENATED_SEGMENTS CHARGE_ACCOUNT
, papf2.FULL_NAME PR_UNIT_HEAD
, haou2.NAME DEPARTMENT
, pha.ATTRIBUTE14 DEPARTMENT_HEADER
from
PO_HEADERS_All pha
, AP_SUPPLIERS aps
, HR_LOCATIONS_V hlv
, HR_LOCATIONS_V hlv2
, per_all_people_f papf
, po_lines_all pla
, mtl_system_items_kfv msik
, PA_PROJECTS_ALL ppa
, pa_tasks_v ptv
, po_distributions_all pda
, hr_all_organization_units haou
, gl_code_combinations_kfv gcck
, per_all_people_f papf2
, hr_all_organization_units haou2
, po_line_locations_all plla
where
pha.VENDOR_ID =aps.VENDOR_ID
and pha.SHIP_TO_LOCATION_ID = hlv.LOCATION_ID
and pha.BILL_TO_LOCATION_ID = hlv2.LOCATION_ID
and pha.AGENT_ID = papf.PERSON_ID
and pha.PO_HEADER_ID = pla.PO_HEADER_ID
and pla.ITEM_ID = msik.INVENTORY_ITEM_ID
and pla.PROJECT_ID = ppa.PROJECT_ID (+)
and pla.TASK_ID = ptv.TASK_ID (+)
and pla.PO_LINE_ID = pda.PO_LINE_ID
and pda.EXPENDITURE_ORGANIZATION_ID = haou.ORGANIZATION_ID (+)
and pda.PO_DISTRIBUTION_ID = gcck.CODE_COMBINATION_ID
and pha.ATTRIBUTE1 = papf2.PERSON_ID (+)
and pha.ATTRIBUTE3 = haou2.ORGANIZATION_ID (+)
and pla.PO_LINE_ID = plla.PO_LINE_ID
Comments
Post a Comment