Skip to main content

OracleApps SQL Queries


Entity Structure:

select
LEV.LEDGER_ID LEDG_ID,
LEV.LEDGER_NAME,
LEV.CURRENCY_CODE CCY,
LEV.LEGAL_ENTITY_ID LE_ID,
LEV.LEGAL_ENTITY_NAME,
LAD.ADDRESS_LINE_1,
LAD.ADDRESS_LINE_2,
LAD.ADDRESS_LINE_3,
LAD.TOWN_OR_CITY,
LAD.COUNTRY,
OOD.OPERATING_UNIT OU_ID,
OU.OPERATING_UNIT_NAME,
OU.LOCATION_NAME,
LEV.LOCATION_ID LOC_ID,
LEV.LOCATION_CODE LOC_CODE,
OOD.ORGANIZATION_ID ORG_ID,
OOD.ORGANIZATION_CODE ORG_CODE,
OOD.ORGANIZATION_NAME,
houv.location_code,
mp.attribute7

FROM
      APPS.GL_LEDGER_LE_V LEV,
      apps.org_organization_definitions OOD,
      apps.HRFV_OPERATING_UNITS OU,
      APPS.HR_LOCATION_LEGAL_ADR_V LAD,
    apps.mtl_parameters mp
,APPS.GL_LEDGERS gl
,apps.HR_ORGANIZATION_UNITS_V houv
WHERE
        LEV.LEGAL_ENTITY_ID=OOD.LEGAL_ENTITY
AND   OOD.OPERATING_UNIT=OU.OPERATING_UNITS_ID
AND   OU.LOCATION_ID=LAD.LOCATION_ID(+)
and ood.organization_code = mp.organization_code

and gl.ledger_id = lev.ledger_id
and gl.ledger_category_code = 'PRIMARY'

and houv.organization_id = OOD.ORGANIZATION_ID
and mp.organization_code = 'BRD'
--and LEV.CURRENCY_CODE = 'TWD'
--AND OOD.OPERATING_UNIT = 1851
order by
OOD.OPERATING_UNIT
;

Comments

Popular posts from this blog

Oracle WMS Outbound Query

/*  ************************************************************************************************************          OUTBOUND METRICS           Released to Warehouse --> Staged/Pick Confirmed      ************************************************************************************************************  */  SELECT mp.organization_code "Warehouse", wda.delivery_id "Delivery", wt.name "Trip", (SELECT MEANING FROM apps.FND_LOOKUP_VALUES_VL WHERE lookup_type = 'PICK_STATUS' AND LOOKUP_CODE = wdd.released_status) "Delivery Status", CASE  WHEN wdt_extra.move_order_line_id IS NOT NULL THEN (SELECT MEANING FROM apps.FND_LOOKUP_VALUES_VL WHERE lookup_type = 'WMS_TASK_STATUS' AND LOOKUP_CODE = wdt_extra.status)  WHEN mmtt.wms_task_status IS NOT NULL THEN (SELECT MEANING FROM apps.FND_LOOKUP_VALUES_VL WHERE lookup_type = 'WMS_TASK_STATUS' AND LOOKUP_CODE = mmtt.wms_task_status) ...

Oracle WMS Tasks Query

SELECT *   FROM (SELECT wdth.transaction_temp_id,                wdth.task_id,                oeh.order_number,                oel.line_number,                msi.concatenated_segments item_number,                'Pick',                'Completed',                fu1.user_name             assigned_to,                wdth.person_id,                mmtt.transaction_quantity,                mmtt.transaction_uom           FROM apps.oe_order_headers_all         oeh,         ...

Oracle WMS Inbound Query

/*  ************************************************************************************************************          INBOUND METRICS           Lines in-transit      ************************************************************************************************************  */  SELECT mp.organization_code "Warehouse", rsh.receipt_num "Receipt Number", rsh.shipment_num "Shipment Number", wt.name "Trip", NULL "Putaway LPN", NULL "Putaway Subinventory", NULL "Putaway Locator", msib.segment1 "Item", (select c_ext_attr11||'/'||c_ext_attr12 from apps.ego_mtl_sy_items_ext_b where organization_id = 89 and inventory_item_id = msib.inventory_item_id and attr_group_id = 42) "Item Temperature", (rsl.quantity_shipped-rsl.quantity_received) "Quantity", decode(msib.serial_number_control_code,1,'No','Yes') "Serial Item", (cic.item_cost * (rsl.q...