select poh.SEGMENT1,
poh.TYPE_LOOKUP_CODE,
poh.CREATION_DATE,
pov.VENDOR_NAME,
pvs.VENDOR_SITE_CODE,
hrl.LOCATION_CODE"ship_to",
hrl.LOCATION_CODE"bill_to",
poh.AUTHORIZATION_STATUS "status",
papf.FULL_NAME,
poh.CURRENCY_CODE,
pol.QUANTITY*pol.UNIT_PRICE "amount",
pol.LINE_NUM,
plt.LINE_TYPE,
msi.SEGMENT1"item",
mck.CONCATENATED_SEGMENTS,
mum.UNIT_OF_MEASURE,
pol.QUANTITY "qty",
pol.UNIT_PRICE "price",
pll.SHIPMENT_NUM,
ood.ORGANIZATION_CODE,
hrl.LOCATION_CODE,
pll.QUANTITY,
pll.NEED_BY_DATE,
pod.DISTRIBUTION_NUM,
pod.QUANTITY_ORDERED,
GCC.CONCATENATED_SEGMENTS "account num"
from po_headers_all poh,
po_vendors pov,
po_vendor_sites_all pvs,
hr_locations hrl,
per_all_people_f papf,
po_agents poa,
po_lines_all pol,
mtl_system_items_b msi,
mtl_categories_kfv mck,
mtl_item_categories mic,
mtl_category_sets mcs,
mtl_units_of_measure mum,
po_line_locations_all pll,
org_organization_definitions ood,
po_distributions_all pod,
po_line_types plt ,
GL_CODE_COMBINATIONS_KFV GCC,
GL_SETS_OF_BOOKS GSB
where poh.segment1='4696'
and poh.VENDOR_ID=pov.VENDOR_ID
and poh.VENDOR_SITE_ID=pvs.VENDOR_SITE_ID
and poh.SHIP_TO_LOCATION_ID=hrl.SHIP_TO_LOCATION_ID
and poh.BILL_TO_LOCATION_ID=hrl.LOCATION_ID
and poh.AGENT_ID=poa.AGENT_ID
and poa.AGENT_ID=papf.PERSON_ID
and poh.PO_HEADER_ID=pol.PO_HEADER_ID
and pol.ITEM_ID=msi.INVENTORY_ITEM_ID
and pol.ORG_ID=msi.ORGANIZATION_ID
and pol.CATEGORY_ID=mck.CATEGORY_ID
and mck.CATEGORY_ID=mic.CATEGORY_ID
and mic.CATEGORY_SET_ID=mcs.CATEGORY_SET_ID
and mic.ORGANIZATION_ID=msi.ORGANIZATION_ID
and mic.INVENTORY_ITEM_ID=msi.INVENTORY_ITEM_ID
and mum.UOM_CODE=msi.PRIMARY_UOM_CODE
and pol.PO_LINE_ID=pll.PO_LINE_ID
and pol.ORG_ID=ood.ORGANIZATION_ID
and pll.SHIP_TO_LOCATION_ID=hrl.SHIP_TO_LOCATION_ID
and pll.LINE_LOCATION_ID=pod.LINE_LOCATION_ID
and pol.LINE_TYPE_ID=plt.LINE_TYPE_ID
and gcc.CODE_COMBINATION_ID=pod.CODE_COMBINATION_ID
and gcc.CHART_OF_ACCOUNTS_ID=gsb.CHART_OF_ACCOUNTS_ID
No comments:
Post a Comment