ECC Inventory Management, Inbound Details, SQL1

Description
Columns: Receiving Id, Ecc Spec Id, Trx Type, Priority Flag, Shipment Line Id, Org Code, Expected Trx Date, Parent Trx Type, Document Num, Document Line Num ...
Imported from ECC
SELECT * FROM (
SELECT
  reiv.ecc_spec_id AS receiving_id,
  reiv.ecc_spec_id,
  reiv.trx_type,
  reiv.priority_flag,
  reiv.shipment_line_id,
  reiv.organization_code,
  reiv.expected_trx_date,
  inv_ecc_inbound_util_pvt.get_lookup_meaning(source_doc_type,'DOC_TYPE',3,msit.language) source_doc_type, --reiv.source_doc_type,
  reiv.parent_trx_type,
  decode(reiv.source_doc_type,'INTSHIP',inv_ecc_inbound_util_pvt.get_organization_name(reiv.source_name,msit.language),
         'REQ',inv_ecc_inbound_util_pvt.get_organization_name(reiv.source_name,msit.language),reiv.source_name) source_name,
  reiv.document_num,
  reiv.document_line_num,
  reiv.item_number,
  msit.description item_description,
  reiv.ordered_qty,
  reiv.primary_qty,
  reiv.trx_qty,
  reiv.amount,
  reiv.routing_id,
  reiv.to_organization_id,
  reiv.item_id,
  reiv.lpn_id,
  reiv.po_header_id,
  reiv.oe_order_header_id,
  reiv.license_plate_number,
  reiv.gross_weight,
  reiv.container_volume,
  reiv.content_volume,
  msit.LANGUAGE LANGUAGE
FROM rcv_ecc_inbound_v reiv,
     mtl_system_items_tl msit
WHERE reiv.item_id = msit.inventory_item_id
AND   reiv.to_organization_id = msit.organization_id
AND   msit.LANGUAGE in ( 'US')--PIVOT uptake change
) PIVOT ( Max(source_doc_type) AS source_doc_type,
          Max(source_name) AS source_name,
          Max(item_description) AS item_description for LANGUAGE in ( 'US' "US"))