on 04-22-2015 11:16 AM
Hi,
How to restrict or block user from edit/change price field in PO.
I found the similar post, but there is no answer on the TN, can anyone please help ?
http://scn.sap.com/thread/3231899
The approval procedure will not meet the requirement as the user is still allow to edit on others field other than POR1.Price
Thanks
Hi Olga,
Please try:
If @object_type='22' and @transaction_type='U'
BEGIN
If Exists (select T0.DocEntry
from OPOR T0
inner join POR1 T1 on T1.DocEntry = T0.DocEntry
where T0.DocEntry = @list_of_cols_val_tab_del
and T1.Quantity <> (select a.Quantity from POR1 a where a.DocEntry = T1.DocEntry
and a.LineNum = T1.LineNum)
)
BEGIN
Select @error = 22, @error_message = 'Update not possible for POR1.Quantity'
End
End
Thanks & Regards,
Alvin
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Olga,
Try below query, working on my side.
If @object_type='22' and @transaction_type='U'
BEGIN
If Exists (select T0.DocEntry
from OPOR T0
inner join POR1 T1 on T1.DocEntry = T0.DocEntry
where T0.DocEntry = @list_of_cols_val_tab_del
and T1.LineTotal <> (select top 1 a.LineTotal from ADO1 a where a.DocEntry = T1.DocEntry
and a.LineNum = T1.LineNum
and a.ObjType = T1.ObjType
order by a.DocDate desc)
)
BEGIN
Select @error = 22,
@error_message = 'Update not possible for POR1.Price'
End
End
Thanks
Alvin
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You will need to use ADOC and ADO1 to find the history price on the same document and then compare.
Frank
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
ADOC, ADO1 is the history table for all transactions.
you will need to compare the current POR1 with ADO1.
I believe the one posted below by Alvin will not work.
SP_TN is actually triggered after table update, but before commit. So Alvin's query is actually comparing record itself.
You will need to compare the POR1 with ADO1 to achieve desired result.
Frank
User | Count |
---|---|
91 | |
8 | |
7 | |
4 | |
4 | |
3 | |
3 | |
3 | |
3 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.