cancel
Showing results for 
Search instead for 
Did you mean: 

Production Order Issue.

Former Member
0 Kudos
450

Dear All,

My Client is working on SAP B1 2007 B PL 19. Now I have a issue in a sense, although I have not made issue to Production than also I can make Receipt from Production and also I can Close the Production Order.

Hence My question is, Is there any way that I can restrict the user to Close the Production Order when Partial or No Issue to Production is made.

Has anybody created a Stored Procedure for it.

Regards

Hitesh Parsawala

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi Hitesh......

You can make it possible by executing SP for Production order where your users will not be able to close the Production order if its not fully issued or received...

This SP would be user specific......

Regards,

Rahul

Former Member
0 Kudos

Hi Rahul,

I know that it is possible through Stored Procedure Notification, but Is there anybody who has made this Stored Procedure. If Yes than kindly provide me with the same.

Regards

Hitesh Parsawala

Former Member
0 Kudos

Hi Hitesh......

Try this......

If @object_type='202' and @transaction_type='L'
BEGIN 
If Exists (Select T0.ItemCode OWOR T0  INNER JOIN WOR1 T1 ON T0.DocEntry = T1.DocEntry
Where (T0.[CmpltQty]<T0.[PlannedQty] or T1.[IssuedQty]<T1.[PlannedQty])
And T0.DocEntry = @list_of_cols_val_tab_del)
BEGIN
Select @error = -1,
@error_message = 'Production Order canot be closed'
End
End

Hope this would help you......

Regards,

Rahul

former_member206488
Active Contributor
0 Kudos

Hi,

Use below code in transcation notification procedure


--Block the receipt of production without issue of componet items
IF @transaction_type = 'A' AND @Object_type = '59'
BEGIN
IF EXISTS (SELECT T0.DOCENTRY FROM dbo.IGN1 T0 WHERE T0.DOCENTRY = @list_of_cols_val_tab_del)
BEGIN
DECLARE @entry INT 
SELECT @entry = T0.BASEENTRY FROM dbo.IGN1 T0 WHERE T0.DOCENTRY = @list_of_cols_val_tab_del

IF EXISTS (SELECT T1.ITEMCODE, T1.PLANNEDQTY, T2.QUANTITY, T2.BASEENTRY AS [ISSUED QTY] FROM dbo.OWOR T0 INNER JOIN dbo.WOR1 T1 
ON T0.DOCENTRY = T1.DOCENTRY LEFT OUTER JOIN dbo.IGE1 T2 ON T2.BASEENTRY = T0.DOCENTRY AND T1.ITEMCODE = T2.ITEMCODE WHERE T1.PLANNEDQTY > ISNULL(T2.QUANTITY, 0) AND T0.DOCENTRY = @entry AND T1.IssueType='M')

SELECT @Error = 1, @error_message = 'Receipt from Production cannot be done withouse issue of components'
END
ELSE 
SELECT @Error = 1, @error_message = 'Receipt from Production cannot be done withouse issue of components'
END

--Block production order status to be closed without receiving the finished product
IF (@object_type = '202' AND @transaction_type= 'U')
BEGIN
if exists
 (Select pl.PlannedQty 
   From OWOR p 
   inner Join WOR1 pl On pl.DocEntry=p.DocEntry
  Where p.DocEntry = @list_of_cols_val_tab_del
   and p.Status='L'
   and pl.PlannedQty>pl.IssuedQty)
Begin
set @error =1
set @error_message = 'Production Order can not be Closed,Issue or receipt is not done yet'
End
END

Thanks,

Neetu