Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

What is the appropriate table to be added in this query to show PO Number?

642955Jun 3 2008 — edited Jun 4 2008
Hi All,

Good day!

What is the appropriate table to be added or included in the query below to show the PO Number?

SELECT moq.organization_id, moq.inventory_item_id,
msi.segment1 || '~' || msi.segment2 item_code, msi.description,
mcb.segment4 product_line, moq.subinventory_code, moq.locator_id,
mil.segment1
|| '-'
|| mil.segment2
|| '-'
|| mil.segment3
|| '-'
|| mil.segment4 LOCATOR,
moq.transaction_uom_code, moq.lot_number, mln.expiration_date,
moq.date_received, SUM (moq.transaction_quantity) quantity
FROM mtl_onhand_quantities_detail moq,
mtl_system_items_b msi,
mtl_item_categories mic,
mtl_categories_b mcb,
mtl_item_locations mil,
mtl_lot_numbers mln
WHERE moq.organization_id = msi.organization_id
AND moq.inventory_item_id = msi.inventory_item_id
AND msi.organization_id = mic.organization_id
AND msi.inventory_item_id = mic.inventory_item_id
AND mic.category_id = mcb.category_id
AND moq.organization_id = mil.organization_id
AND moq.locator_id = mil.inventory_location_id
AND moq.organization_id = mln.organization_id
AND moq.inventory_item_id = mln.inventory_item_id
AND moq.lot_number = mln.lot_number
AND moq.organization_id = 103
AND mcb.segment4 = 'SUP:HPP'
GROUP BY moq.organization_id,
moq.inventory_item_id,
msi.segment1 || '~' || msi.segment2,
msi.description,
mcb.segment4,
moq.subinventory_code,
moq.locator_id,
mil.segment1
|| '-'
|| mil.segment2
|| '-'
|| mil.segment3
|| '-'
|| mil.segment4,
moq.transaction_uom_code,
moq.lot_number,
mln.expiration_date,
moq.date_received;

I just want to show the PO Number of every item in mtl_onhand_quantities_detail, but I cannot find a View that uses it and displays PO Number. I have no idea on the structure of our database for ERP because we have no document for its diagram. We are just using metalink, but I cannot get the enough answer.

Please help me on this matter. Thank you.

Sincerely,
Raul
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jul 2 2008
Added on Jun 3 2008
4 comments
881 views