Home » SQL & PL/SQL » SQL & PL/SQL » Script to categorize the DJ aging (Apps: EBS 11.5.10.2, DB: 9.2.0.6)
Script to categorize the DJ aging [message #346630] |
Tue, 09 September 2008 03:28 |
jasmine.hue
Messages: 17 Registered: August 2008 Location: Penang, Malaysia
|
Junior Member |
|
|
Hi experts,
I had some asistant at my SQL scripts, I am calculating the DJ againg. However, I had different aging acceptance level different inventory org. For example:
Org A: the DJ aging acceptance level is 10days
Org B: the DJ aging acceptance level is 21days
Org C: the DJ aging acceptance level is 15days
Other orgs: the DJ aging acceptance level is 5days
Below is my scripts:
select
wdj.ORGANIZATION_ID AS "ORG",
WE.WIP_ENTITY_NAME "JOB",
(ASSY.SEGMENT1||'-'||ASSY.SEGMENT2||'-'||ASSY.SEGMENT3) AS "ASSEMBLY",
ASSY.DESCRIPTION AS "ASSEMBLY DESC",
paa.NAME||'.'||pat.TASK_NUMBER as "PROJECT",
ML1.MEANING STATUS,
WDJ.DATE_RELEASED,
WE.CREATION_DATE,
ROUND(SYSDATE - WE.CREATION_DATE) AS AGING,
ROUND(SYSDATE - WE.CREATION_DATE) AS AGING2,
WDJ.ATTRIBUTE1 AS "REMARKS",
WDJ.ATTRIBUTE2 AS "SO NUM",
WDJ.ATTRIBUTE3 AS "S0 LN"
from
WIP_ENTITIES WE,
MFG_LOOKUPS ML1,
MTL_SYSTEM_ITEMS ASSY,
WIP_DISCRETE_JOBS WDJ,
PA_PROJECTS_ALL PAA,
PA_TASKS PAT
Where ML1.LOOKUP_TYPE = 'WIP_JOB_STATUS'
and we.ORGANIZATION_ID = wdj.ORGANIZATION_ID
and we.WIP_ENTITY_ID = wdj.WIP_ENTITY_ID
AND ML1.LOOKUP_CODE = WDJ.STATUS_TYPE
AND WE.PRIMARY_ITEM_ID = ASSY.INVENTORY_ITEM_ID
AND WE.ORGANIZATION_ID = ASSY.ORGANIZATION_ID
and wdj.PROJECT_ID = paa.PROJECT_ID
and wdj.TASK_ID = pat.TASK_ID
and wdj.ORGANIZATION_ID not in (124,125,126,127,101,128,106,105,135,109,108,110,102,103,111,112)
and WDJ.STATUS_TYPE not in (4,5,7,12,14,15)
group by
WE.WIP_ENTITY_NAME,
(ASSY.SEGMENT1||'-'||ASSY.SEGMENT2||'-'||ASSY.SEGMENT3),
ASSY.DESCRIPTION,
ML1.MEANING,
WDJ.DATE_RELEASED,
WE.CREATION_DATE,
ROUND(SYSDATE - WE.CREATION_DATE),
wdj.ORGANIZATION_ID,
WDJ.ATTRIBUTE1,
WDJ.ATTRIBUTE2,
WDJ.ATTRIBUTE3,
paa.NAME,
pat.TASK_NUMBER
order by wdj.ORGANIZATION_ID asc, (ASSY.SEGMENT1||'-'||ASSY.SEGMENT2||'-'||ASSY.SEGMENT3) asc;/*--============ table fields listing===============
--
--1= unreleased
--3= released
--4= complete
--5= complete- No Charges
--6= On hold
--7= cancelled
--8= pending Bill Load
--9= failed bill load
--10=Pending routing load
--11=Failed routing load
--12=Closed
--13=Pending-Mass Loaded
--14=Pending Close
--15=Failed Close
--16=Pending Scheduling
--================================================================
Thanks,
Jasmine
[mod-edit] removed bold, italic and color to help readability.
[Updated on: Wed, 10 September 2008 07:57] by Moderator Report message to a moderator
|
|
|
|
|
|
|
Re: Script to categorize the DJ aging [message #346862 is a reply to message #346860] |
Tue, 09 September 2008 23:22 |
jasmine.hue
Messages: 17 Registered: August 2008 Location: Penang, Malaysia
|
Junior Member |
|
|
Hi Michel,
DJ aging means the number of days that the DJ being active after is has been released. The objective of the DJ aging is to control the DJ closed on time.
What requestor need from this aging report is calculate number of days the dj still active for the report generated date.
Scenario:
DJ from inv org A was created and released to production on 1st-Sept-08. Until today, if the DJ have not been closed, so the aging of this DJ is 9 days.
We have more than 1 inventory org, every inventory org having diff ecceptance level. Certain inv org, the DJ cannot aged for more than 10days. SO this report is to show management the DJ status.
I had calculate the DJ aging by using formula (sysdate-DJ created date). But I don't know how to put the status of "Delayed", "Acceptable" in my report. For example:
Org A: the DJ aging acceptance level is 10days
if aging > 10
then "Delayed"
else "Acceptable"
Org B: the DJ aging acceptance level is 21days
if aging > 21
then "Delayed"
else "Acceptable"
Org C: the DJ aging acceptance level is 15days
if aging > 15
then "Delayed"
else "Acceptable"
Other orgs: the DJ aging acceptance level is 5days
if aging > 5
then "Delayed"
else "Acceptable"
Therefore for my DJ created above, the status is "Acceptable"
Hope this explain well my requirements.
Besides email, you can contact me through:
Yahoo: lyhue802002
Skype: jasminehue
|
|
|
|
|
|
|
|
|
|
|
|
|
Goto Forum:
Current Time: Fri Dec 06 15:07:10 CST 2024
|