Do you know how to enable tracing? You will need to enable tracing, and then perform this procedure in a test environment to know which method to attach the BPM. I would then review the temp table record sets moving within the method. I would do a query to check quantity in the input record matches the completed quantity in the jobhead table. Is this the kind of detail you are wanting or do you need more in depth details.
One approach is to setup a preprocessing directive on the ReceiptsFromMfg.ReceiveMfgPartToInventory Object/Method (That is what it is called in E10, I am thinking this is the same in E9 but you will have to verify that the method exists).
You can drop the following code in an execute code (4GL/ABL) action and it should work. This will not allow them to receive more than the jobs production quantity.
Ross
FOR EACH ttPartTran WHERE (ttPartTran.RowMod = ‘A’ OR ttPartTran.RowMod = ‘U’) NO-LOCK.
DEFINE VARIABLE QtyReceived As INTEGER NO-UNDO INITIAL 0.
DEFINE VARIABLE TextMessage As CHARACTER NO-UNDO.
DEFINE VARIABLE ProdQty AS INTEGER NO-UNDO INITIAL 0.
FIND FIRST JobHead WHERE JobHead.Company = CUR-COMP AND JobHead.JobNum = ttPartTran.JobNum NO-LOCK.
ASSIGN ProdQty = JobHead.ProdQty.
FOR EACH PartTran WHERE PartTran.Company = CUR-COMP AND PartTran.JobNum = ttPartTran.JobNum AND PartTran.TranType = ‘MFG-STK’ NO-LOCK.
QtyReceived = QtyReceived + PartTran.TranQty.
END.
ASSIGN TextMessage = ‘This receipt quantity of ’ + STRING(ttPartTran.TranQty) + ’ will make a total receipt quantity of ’ + STRING(QtyReceived + ttPartTran.TranQty) + ’ exceeding the job’'s production quantity.of ’ + STRING(ProdQty).
IF (QtyReceived + ttPartTran.TranQty) > ProdQty THEN DO:
{lib\PublishEx.i &exMsg = "TextMessage "}
{&THROW_PUBLIC}.
END.
I have tried various combination to try and stop the transaction from happening , but it seems to just display the warning messaging and i can still carry on moving the job to inventory.
/Code for Exception Message …/
{lib\PublishEx.i &exMsg = “TextMessage”}
{&THROW_PUBLIC}. /<— Needed for throwing an exception message, not needed for an informational message./
Also, make sure that is the correct object/method in E9. It is in E10 but I don’t have access to E9 to verify.
To go back to what @jeowings said about tracing, I traced a transaction and when you enter the quantity ReceiptsFromMfg.OnChangeActTranQty is called and ActTranQty holds the value entered. If you throw the exception there then the quantity entered will never be over.
Here is the snipit I always use in an abl exception.
EXCEPTION
define variable Msg as character init ''.
Msg = "Employee " + EmpBasic.EmpID.
{lib/PublishEx.i &ExMsg = Msg &ExType = {&MESSAGE_ERR}}.