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.

No comments:

Post a Comment