Showing results for 
Search instead for 
Did you mean: 

Resstrict production qty more than sale order

Former Member
0 Kudos

Dear Experts,

If for item A having 50 qty in sale order no 1. Then production order is added for that sale order selecting that sale order and project code. if sale order no and project code matches then production planning qty should not more than sale order qty.

Thanks & Regards,


Accepted Solutions (1)

Accepted Solutions (1)

Active Contributor
0 Kudos


Please try this:

IF @transaction_type IN ('A','U') AND

(@Object_type = 202)


If EXISTS (SELECT T0.Docentry FROM OWOR T0 LEFT join RDR1 T1 on  T0.[Project]  =  T1.[Project] INNER JOIN ORDR T2 ON T1.[DocEntry] = T2.[DocEntry]

WHERE T1.[Quantity] <> T0.[PlannedQty] and  T2.[DocNum]  =  T0.[OriginNum]   and  T0.[ItemCode]  =  T1.[ItemCode] and  T0.[Status]  = 'P' and T0.[Docentry] = @list_of_cols_val_tab_del)


SET @error = -1

SET @error_message = N'Planned quantity is more than sales order quantity'




Answers (1)

Answers (1)

Former Member
0 Kudos

Hi Sir,

Thanks a lot for your quick response!

it is not allowing for more quantity in one production order but in case if add more production orders it is allowing.

eg: sale order qty is 5. in production order no 1 , if I add qty 6 it is not allowing . but if i add qty 4 in this production order and opening other production order and now I am giving qty 2 this time it is allowing.

any solution for this

Thanks & regards,