on 10-03-2013 7:13 PM
Hi Experts,
In my Item Master Data, few Items are Discrete Products, like Computer, Laptop, Printers etc, So I maintain their inventory in Numbers/EACH.
I have entered Purchase UoM, Sales UoM and Inventory UoM for those items as EACH.
In my company , there are few users who made some transactions of SALES and PURCHASE of these items of Quantity with Decimal like SALES of 3.7 Computer, Purchase of 8.12 Laptop etc. and transaction had done successfully.
Which is practically wrong.
It has badly effected my Inventory. Now I want to block these type of transaction like if UoM is EACH/NO then user cant make transaction with Decimal values.
Please suggest any SPTN.
Thanking in Advance.
Ramesh Kumar
Hi,
Try this SPTN for PO:
IF @transaction_type in ('A','U') AND (@OBJECT_TYPE='22')
BEGIN
If exists (select T0.DocEntry FROM OPOR T0 INNER JOIN POR1 T1 ON
T0.DocEntry = T1.DocEntry where T0.DocEntry =
@list_of_cols_val_tab_del and T1.[Quantity] <> cast(
T1.[Quantity] as Int))
Begin
SET @error = 10
SET @error_message = 'Please enter correct qty'
End
End
For sales order:
IF @transaction_type in ('A','U') AND (@OBJECT_TYPE='17')
BEGIN
If exists (select T0.DocEntry FROM OPOR T0 INNER JOIN POR1 T1 ON
T0.DocEntry = T1.DocEntry where T0.DocEntry =
@list_of_cols_val_tab_del and T1.[Quantity] <> cast(
T1.[Quantity] as Int))
Begin
SET @error = 10
SET @error_message = 'Please enter correct qty'
End
End
Thanks & Regards,
Nagarajan
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
96 | |
9 | |
8 | |
5 | |
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.