Friday, December 30, 2011

WF DOCUMENT Manager Error

ORA - 04061 : existing state of has been invalidated
ORA - 04065: not xecute,altred or dropped package body


The above errors may occur in WF when we modify or execute any pLSQL WF Package.

Technically when you apply some PLSQL changes to the database that could impact the mailer/notification code, you should shutdown the agent listener service, apply the changes and re-start them. Compiling a PLSQL package in the Database invalidates the state of that package in other active sessions and the next time the other session accesses that package, it appears invalid though in real-time the package is valid.

To release the issue clear the cache and bounce the WF Listener, WF mailer and Agent Listener.

PO Re-Approval

A PO is AUTO Created from REQ and its in Approved status.
If we cancel any REQ line then it will propogate the changes to the PO and the PO will changed to 'Inprocess' States.

To Accept the changes , just login as the PO Buyer and query the PO Summary.
Then go to Tools -> Repsond To Changes.
A separate page will open and you can accept the changes which will cancel the corresponding PO line and it will move the status to 'Approved'.

PO Header Total Amount

The PO Header Total Amount is sum of line amount. It will not include the amount for cancelled lines. If its still picks from the cancelled lines check whether the lines are partially cancelled.
You can check this in the shipments.

For cancelled lines the CLOSED_CODE will be 'CLOSED' and the CANCEL_FLAG will be 'Y'.
If the line got fully cancelled then the QUANTITY will become zero.


,pl.cancel_flag,pl.unit_price,pl.quantity , ( pl.unit_price*pl.quantity) line_amount , sum(( pl.unit_price*pl.quantity)) over(partition by ph.po_header_id) total_amount
,pd.quantity_cancelled,pd.quantity_billed,sum(( pl.unit_price*pd.quantity_billed)) over(partition by ph.po_header_id) matched_amount