cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Restrict to close Production Order If Issue & Receipt Not done both are mandatory. SAP B1 10.0

Kiransonawane
Explorer
0 Likes
1,069

I Want to Restrict users to close Production Order If Issue for Production is not completed even of  Receipt for production is Not done both are mandatory.

Below is my SP_Transaction Notification

IF (@object_type = '202' AND @transaction_type= 'U')

BEGIN

if exists (

SELECT T0.[DocNum]

FROM OWOR T0 INNER JOIN WOR1 T1 ON T0.[DocEntry] = T1.[DocEntry]
WHERE T0.[CmpltQty] =0
and T1.[PlannedQty] > T1.[IssuedQty]
and T0.[Status] = 'L' and T0.DocEntry = @List_of_cols_val_tab_del)

Begin

set @error =1

set @error_message = 'Production Order can not be Closed,until issue and receipt done'

End

END

Accepted Solutions (1)

Accepted Solutions (1)

narayanis
Active Contributor
0 Likes

Hi,

What is the issue over here are you facing. Since I don't have system right now, I can't execute and check

 

Kiransonawane
Explorer
0 Likes
query is working only if production order is in Release mode and issue for production is not completed. query is not restricted to close if receipt of production after issue for production is done. I want to restrict user to close production order mistakenly any of them is pending stage

Answers (1)

Answers (1)

narayanis
Active Contributor
0 Likes

Hi,

Just a bracket issue. Check with this.

SELECT T0.[DocNum]

FROM OWOR T0 INNER JOIN WOR1 T1 ON T0.[DocEntry] = T1.[DocEntry]
WHERE (T0.[CmpltQty] =0
or T1.[PlannedQty] > T1.[IssuedQty])
and T0.[Status] = 'L' and T0.DocEntry = @List_of_cols_val_tab_del)

Kiransonawane
Explorer
0 Likes
query is working only if production order is in Release mode and issue for production is not completed. query is not restricted to close if receipt of production after issue for production is done