Friday, February 27, 2009

How to Restrict Finally Close control Action in Purchase Summary Form using Form Personalization.

AP users are not able to match to PO to a finally closed PO’s as
PO User are Closing the PO with Finally Closed options without the
PO being invoiced.
When AP users try to match the invoice to the PO they get the
following error message.
Error: APP-SQLAP-97198: You cannot match to this Purchase order
shipment because it is finally closed.
To avoid such issues going forward PO and AP supers user have advised
IT team to Inactive the finally close option to users.

This can be achieved through Form Personalization as given below:
1. Go to Purchase Orders Summary form > query for a PO >
after the header of the PO is shown go to
Help >Diagnostics > Custom Code > Personalize.
the Form Personalization open.












Function Name = PO_POXPOVPO
Form Name = POXPOVPO
Debug Mode = Off
Steps:
- Seq = 1
- Description = Stop Final Close from Control Menu
- Level = Function
- Enable is checked.
Condition tab:
- Trigger Event = WHEN-VALIDATE-RECORD
- Trigger Object = PO_DOCON_CONTROL
- Condition =:po_docon_control.action= 'FINALLY CLOSE'
- Processing Mode = Both

Actions tab:
- Seq = 1
- Type = Message
- Description= Blank
- Lanuage=All
- Enabled is checked
- Message Type = Show



- Message Text = :You do not have the permission to Finally Close
Purchase Order.
Finally Closed is a restricted function that should
only be performed once A/P has been consulted
- Please use another function.

- Seq = 2
- Type = Property
- Language = All
- Enabled is checked
- Object Type = Item
- Target Object = PO_DOCON_CONTROL.ACTION
- Property Name = VALUE
- Value = Leave it blank.
- Save




In tab Condition in zone
Context can chose level= User and select users for which this
restriction to be done

Context:
Level Value
------ -------
Responsibility US Purchase Requestor
Responsibility US Purchase Manager

2. Logout/login with the user set on the personalize window and try
to finallyclose a PO. After press on Finally Close action a message
appear as given below:
:You do not have the permission to Finally Close Purchase Order.
Finally Closed is a restricted function that should only be performed
once A/P has been consulted - Please use another function.
click OK and perform other action and exist.
Datafix To open the PO from Finally close to Close:
===========================================
(Please test in your test instance before you migrate to Prod)
Data Fix:
=======

--1) Find po_header_id:

select po_header_id
from po_headers_all
where segment1 in ('1920','3116');

--2) Verify status on PO Header

select closed_code
from po_headers_all
where po_header_id in (971,3622);

--2a) Update closed_code from FINALLY CLOSED to CLOSED:

update po_headers_all
set closed_code = 'CLOSED'
where po_header_id in (971,3622)
and closed_code = 'FINALLY CLOSED';

commit;

--3) Verify status on PO Line

select closed_code
from po_lines_all
where po_header_id in (971,3622);

--3a) Update closed_code from FINALLY CLOSED to CLOSED:

update po_lines_all
set closed_code = 'CLOSED'
where po_header_id in (971,3622)
and closed_code = 'FINALLY CLOSED';

commit;

--4) Verify status on PO Shipment

select closed_code
from po_line_locations_all
where po_header_id in (971,3622);

--4a) Update closed_code from FINALLY CLOSED to CLOSED:

update po_line_locations_all
set closed_code = 'CLOSED'
where po_header_id in (971,3622)
and closed_code = 'FINALLY CLOSED';

commit;

--5) Verify Action History on Finally Closed record

select count(*) from po_action_history
where object_id in (971,3622)
and action_code = 'FINALLY CLOSE';

--5a) Remove Action History on Finally Closed record

delete from po_action_history
where object_id in (971,3622)
and action_code = 'FINALLY CLOSE';

commit;
6) Go to Purchasing Order Entry form. Query the PO. Navigate to
Special -> Control. Open the PO
.
Note:Oracle does't recommend to re-open Finally Closed PO's as
this leaves a very poor audit trail and there is a potential for data
corruption in related tables.
Other solutions for the above issue is:
1. Manual GL journals OR
2. Create manual distributions in AP invoice.

Wednesday, February 4, 2009

Purchase Order Statuses


Open: You can open at the header, line, and shipment levels.
Open for Receiving: You can reopen for receiving at the header,

line, and shipment level.
Open for Invoicing: You can reopen for invoicing at the header,

line,and shipment level.
Close: Purchasing automatically closes shipments for receiving

and invoicing based on controls that you specify in the Purchasing
Options window. Once all shipments for a given line are closed,
Purchasing automatically closes the line. When all lines for a given
header are closed, Purchasing automatically closes the document.
Close for Receiving: The Receipt Close Tolerance lets you specify
a quantity percentage within which Purchasing closes a partially
received shipment. For example, if your Receipt Close Tolerance
is 5% and you receive 96% of an expected shipment, Purchasing
automatically closes this shipment for receiving.The Receipt Close
Point lets you choose which receiving action (Received, Accepted,
or Delivered) you want to use as the point when Purchasing closes
a shipment for receiving based on the Receipt Close Tolerance.
For example, if you set a Receipt Close Tolerance of 5% and
choose Delivered as your Receipt Close Point, Purchasing closes
shipments for receiving when you have delivered 95% or more
of the ordered quantity.
Close for Invoicing: The Invoice Close Tolerance lets you specify

a similar quantity percentage within which Purchasing automatically
closes partially invoiced shipments for invoicing.
Unfreeze: You can unfreeze only at the header and release levels.
Delete: Before documents are approved, you can delete them or

their components from the document entry window. If you use
online requisitions, Purchasing returns all requisitions associated
with your delete action to the requisition pool. You can reassign
these unfilled requisitions to other purchase orders or releases
using the AutoCreate Documents window.
Cancel: Purchasing lets you terminate an existing commitment

to buy from a supplier by canceling document headers, lines,
shipments, or releases. When you cancel a purchase order entity,
you are unable to receive or pay for cancelled items and services,
however, you can pay for all previously received orders.
You also cannot modify a cancelled entity or its components.
Final Close: Prevent modifications to or actions against

completed documents, lines, and shipments by final closing them.
Final-closed documents are not accessible in the corresponding
entry forms, and you cannot perform the following actions against
final-closed entities: Receive Transfer, Inspect, Deliver, Correct
receipt quantities, Invoice, Return to supplier, or Return to
receiving.You can approve documents that include final-closed
entities, but you cannot approve documents that are final closed
at the header level. You can print final-closed documents.
Finally, you can Purge documents that were final closed at the
header level before the Last Activity Date that you specify when
you submit Purge.
Freeze: Freeze your purchase orders and releases to prevent

changes or additions while maintaining the ability to receive and
match invoices against received shipments. You cannot access
frozen documents in the entry forms.
Hold: Place documents on hold to un-approve them while

preventing printing, receiving, invoicing, and future approval
until you remove the hold.
Firm: When you firm an order, Master Scheduling/MRP uses

the firm date to create a time fence within which it will not
suggest new planned purchase orders, cancellations, or
reschedule–in actions. It continues to suggest reschedule–out
actions for orders within the time fence. If several shipments
with different promised or need–by dates reference the same
item, Master Scheduling/MRP sets the time fence at the latest
of all scheduled dates.You can firm orders at the document
header or shipment level. If you firm at the header level,
Purchasing applies this control to every shipment on the document.