Order Management All Customize Reports Oracle Apps R12
1. Item Group and Month wise Delivery Status Pivot Report.
SQL Query for Order Management Pivot Report.
/* Formatted on 10/10/2019 2:22:44 PM (QP5 v5.227.12220.39724) */
SELECT ITEM_GRP,
SUM (NVL (JANUARY_QTY, 0)) JANUARY_QTY,
SUM (NVL (FEBRUARY_QTY, 0)) FEBRUARY_QTY,
SUM (NVL (MARCH_QTY, 0)) MARCH_QTY,
SUM (NVL (APRIL_QTY, 0)) APRIL_QTY,
SUM (NVL (MAY_QTY, 0)) MAY_QTY,
SUM (NVL (JUNE_QTY, 0)) JUNE_QTY,
SUM (NVL (JULY_QTY, 0)) JULY_QTY,
SUM (NVL (AUGUST_QTY, 0)) AUGUST_QTY,
SUM (NVL (SEPTEMBER_QTY, 0)) SEPTEMBER_QTY,
SUM (NVL (OCTOBER_QTY, 0)) OCTOBER_QTY,
SUM (NVL (NOVEMBER_QTY, 0)) NOVEMBER_QTY,
SUM (NVL (DECEMBER_QTY, 0)) DECEMBER_QTY
FROM ( SELECT IC.SEGMENT2 ITEM_GRP,
--TRUNC (MT.TRANSACTION_DATE) TRANS_DATE,
TO_CHAR (MT.TRANSACTION_DATE, 'MONTH') ORDERED_MONTH,
TO_CHAR (MT.TRANSACTION_DATE, 'MM') MONTH_NUM,
TO_CHAR (TO_DATE (MT.TRANSACTION_DATE, 'dd-mon-yy'), 'Month')
Mont,
NVL (SUM ( (MT.TRANSACTION_QUANTITY) * -1), 0) DELV_QTY
FROM MTL_SYSTEM_ITEMS_B IT,
MTL_MATERIAL_TRANSACTIONS MT,
MTL_ITEM_CATEGORIES_V IC,
ORG_ORGANIZATION_DEFINITIONS OOD
WHERE IT.INVENTORY_ITEM_ID = MT.INVENTORY_ITEM_ID
AND IT.ORGANIZATION_ID = MT.ORGANIZATION_ID
AND TO_CHAR (MT.TRANSACTION_DATE, 'YYYY') = :P_YEAR
/* AND TRUNC (MT.TRANSACTION_DATE) BETWEEN NVL (
:P_DATE_FROM,
TRUNC (
MT.TRANSACTION_DATE))
AND NVL (
:P_DATE_TO,
TRUNC (
MT.TRANSACTION_DATE))*/
AND TO_CHAR (MT.TRANSACTION_DATE, 'MM') BETWEEN :P_FMONTH
AND :P_TMONTH
--AND IT.ORGANIZATION_ID = :P_ORGANIZATION_ID --284 -- FOR SPBML-Door
AND IT.ORGANIZATION_ID = OOD.ORGANIZATION_ID
AND OOD.OPERATING_UNIT = :P_OPERATING_UNIT_ID --279--For SPBML
AND MT.TRANSACTION_TYPE_ID IN (33) -- 3 Direct Org Transfer, 21 Intransit Shipment
AND MT.TRANSACTION_QUANTITY < 0
AND IT.INVENTORY_ITEM_ID =
NVL (:P_ITEM_ID, IT.INVENTORY_ITEM_ID) --31201
AND IT.INVENTORY_ITEM_ID = IC.INVENTORY_ITEM_ID
AND IT.ORGANIZATION_ID = IC.ORGANIZATION_ID
AND IC.SEGMENT1 = 'Finished Goods' --NVL (:P_ITEM_CAT, IC.SEGMENT1) --Finished Goods
AND IC.SEGMENT2 = NVL (:P_ITEM_GROUP, IC.SEGMENT2)
GROUP BY IC.SEGMENT2,
TO_CHAR (MT.TRANSACTION_DATE, 'MONTH'),
TO_CHAR (MT.TRANSACTION_DATE, 'MM'),
MT.TRANSACTION_DATE) PIVOT (MAX (DELV_QTY) QTY
FOR MONTH_NUM
IN ('01' JANUARY,
'02' FEBRUARY,
'03' MARCH,
'04' APRIL,
'05' MAY,
'06' JUNE,
'07' JULY,
'08' AUGUST,
'09' SEPTEMBER,
'10' OCTOBER,
'11' NOVEMBER,
'12' DECEMBER)) PVT
GROUP BY ITEM_GRP
Output:
1. Item Group and Month wise Delivery Status Pivot Report.
SQL Query for Order Management Pivot Report.
/* Formatted on 10/10/2019 2:22:44 PM (QP5 v5.227.12220.39724) */
SELECT ITEM_GRP,
SUM (NVL (JANUARY_QTY, 0)) JANUARY_QTY,
SUM (NVL (FEBRUARY_QTY, 0)) FEBRUARY_QTY,
SUM (NVL (MARCH_QTY, 0)) MARCH_QTY,
SUM (NVL (APRIL_QTY, 0)) APRIL_QTY,
SUM (NVL (MAY_QTY, 0)) MAY_QTY,
SUM (NVL (JUNE_QTY, 0)) JUNE_QTY,
SUM (NVL (JULY_QTY, 0)) JULY_QTY,
SUM (NVL (AUGUST_QTY, 0)) AUGUST_QTY,
SUM (NVL (SEPTEMBER_QTY, 0)) SEPTEMBER_QTY,
SUM (NVL (OCTOBER_QTY, 0)) OCTOBER_QTY,
SUM (NVL (NOVEMBER_QTY, 0)) NOVEMBER_QTY,
SUM (NVL (DECEMBER_QTY, 0)) DECEMBER_QTY
FROM ( SELECT IC.SEGMENT2 ITEM_GRP,
--TRUNC (MT.TRANSACTION_DATE) TRANS_DATE,
TO_CHAR (MT.TRANSACTION_DATE, 'MONTH') ORDERED_MONTH,
TO_CHAR (MT.TRANSACTION_DATE, 'MM') MONTH_NUM,
TO_CHAR (TO_DATE (MT.TRANSACTION_DATE, 'dd-mon-yy'), 'Month')
Mont,
NVL (SUM ( (MT.TRANSACTION_QUANTITY) * -1), 0) DELV_QTY
FROM MTL_SYSTEM_ITEMS_B IT,
MTL_MATERIAL_TRANSACTIONS MT,
MTL_ITEM_CATEGORIES_V IC,
ORG_ORGANIZATION_DEFINITIONS OOD
WHERE IT.INVENTORY_ITEM_ID = MT.INVENTORY_ITEM_ID
AND IT.ORGANIZATION_ID = MT.ORGANIZATION_ID
AND TO_CHAR (MT.TRANSACTION_DATE, 'YYYY') = :P_YEAR
/* AND TRUNC (MT.TRANSACTION_DATE) BETWEEN NVL (
:P_DATE_FROM,
TRUNC (
MT.TRANSACTION_DATE))
AND NVL (
:P_DATE_TO,
TRUNC (
MT.TRANSACTION_DATE))*/
AND TO_CHAR (MT.TRANSACTION_DATE, 'MM') BETWEEN :P_FMONTH
AND :P_TMONTH
--AND IT.ORGANIZATION_ID = :P_ORGANIZATION_ID --284 -- FOR SPBML-Door
AND IT.ORGANIZATION_ID = OOD.ORGANIZATION_ID
AND OOD.OPERATING_UNIT = :P_OPERATING_UNIT_ID --279--For SPBML
AND MT.TRANSACTION_TYPE_ID IN (33) -- 3 Direct Org Transfer, 21 Intransit Shipment
AND MT.TRANSACTION_QUANTITY < 0
AND IT.INVENTORY_ITEM_ID =
NVL (:P_ITEM_ID, IT.INVENTORY_ITEM_ID) --31201
AND IT.INVENTORY_ITEM_ID = IC.INVENTORY_ITEM_ID
AND IT.ORGANIZATION_ID = IC.ORGANIZATION_ID
AND IC.SEGMENT1 = 'Finished Goods' --NVL (:P_ITEM_CAT, IC.SEGMENT1) --Finished Goods
AND IC.SEGMENT2 = NVL (:P_ITEM_GROUP, IC.SEGMENT2)
GROUP BY IC.SEGMENT2,
TO_CHAR (MT.TRANSACTION_DATE, 'MONTH'),
TO_CHAR (MT.TRANSACTION_DATE, 'MM'),
MT.TRANSACTION_DATE) PIVOT (MAX (DELV_QTY) QTY
FOR MONTH_NUM
IN ('01' JANUARY,
'02' FEBRUARY,
'03' MARCH,
'04' APRIL,
'05' MAY,
'06' JUNE,
'07' JULY,
'08' AUGUST,
'09' SEPTEMBER,
'10' OCTOBER,
'11' NOVEMBER,
'12' DECEMBER)) PVT
GROUP BY ITEM_GRP
Output:
Order Management All Customize Reports
Reviewed by oracle e-business Suite R12
on
October 10, 2019
Rating:
No comments: