×
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Contact US

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

BPM query

BPM query

BPM query

(OP)

Hello,

I need to show an informational warning box when the receiving stock via Job Receipt to Inventory. However, the warning should only appear when the total booked in i.e. sub total of Part Tran\Tran Qty by Job No is greater than the Job Head\Job Prod.

I have created a BPM rule based on the ReceiptsFromMfg.OnChangeTranQty method code. The pre-processing condition then states: number of rules in TEST query is more than 0.

Action: Show informational message.

The TEST query is based on the following syntax:

for last ttPartTran where (ttPartTran.RowMod = 'A' or ttPartTran.RowMod = 'U' and ttPartTran.TranType = 'MFG-STK' and ttPartTran.WareHouseCode = 'GHD') , each jobhead where jobhead.Company = ttPartTran.Company and jobhead.JobNum = ttPartTran.JobNum and ttPartTran.TranQty > jobhead.ProdQty no-lock

The above query works on a single level, however, I need the prompt to appear only when the sum of the ttPartTran.TranQty by the Job Number is greather than the Job Head.Job Prod - does anybody know the correct syntax?

Thanks,
Michael

RE: BPM query

(OP)
I have tried the following to no avail:

for each ttPartTran BREAK BY ttPartTran.JobNum where (ttPartTran.RowMod = 'A' or ttPartTran.RowMod = 'U' and ttPartTran.TranType = 'MFG-STK' and ttPartTran.WareHouseCode = 'GHD') , each jobhead (TOTAL BY ttPartTran.JobNum) where jobhead.Company = ttPartTran.Company and jobhead.JobNum = ttPartTran.JobNum and ttPartTran.TranQty > jobhead.ProdQty no-lock

for each ttPartTran BREAK BY ttPartTran.JobNum where (ttPartTran.RowMod = 'A' or ttPartTran.RowMod = 'U' and ttPartTran.TranType = 'MFG-STK' and ttPartTran.WareHouseCode = 'GHD') , each jobhead (TOTAL BY JobHead.JobNum) where jobhead.Company = ttPartTran.Company and jobhead.JobNum = ttPartTran.JobNum and ttPartTran.TranQty > jobhead.ProdQty no-lock

for each ttPartTran BREAK BY ttPartTran.JobNum where (ttPartTran.RowMod = 'A' or ttPartTran.RowMod = 'U' and ttPartTran.TranType = 'MFG-STK' and ttPartTran.WareHouseCode = 'GHD') , each jobhead BREAK BY JobHed.job num where jobhead.Company = ttPartTran.Company and jobhead.JobNum = ttPartTran.JobNum and ttPartTran.TranQty > jobhead.ProdQty no-lock

for each ttPartTran BREAK BY ttPartTran.JobNum where (ttPartTran.RowMod = 'A' or ttPartTran.RowMod = 'U' and ttPartTran.TranType = 'MFG-STK' and ttPartTran.WareHouseCode = 'GHD') , each jobhead BREAK BY jobhead.JobNum where jobhead.Company = ttPartTran.Company and jobhead.JobNum = ttPartTran.JobNum and (Total by ttPartTran.TranQty) > jobhead.ProdQty no-lock

for each ttPartTran BREAK BY ttPartTran.JobNum where (ttPartTran.RowMod = 'A' or ttPartTran.RowMod = 'U' and ttPartTran.TranType = 'MFG-STK' and ttPartTran.WareHouseCode = 'GHD') , each jobhead BREAK BY jobhead.JobNum where jobhead.Company = ttPartTran.Company and jobhead.JobNum = ttPartTran.JobNum and ttPartTran.TranQty) > jobhead.ProdQty (Total) no-lock

for each ttPartTran BREAK BY ttPartTran.JobNum where (ttPartTran.RowMod = 'A' or ttPartTran.RowMod = 'U' and ttPartTran.TranType = 'MFG-STK' and ttPartTran.WareHouseCode = 'GHD') , each jobhead BREAK BY jobhead.JobNum where jobhead.Company = ttPartTran.Company and jobhead.JobNum = ttPartTran.JobNum and ttPartTran.TranQty) > jobhead.ProdQty (Total by jobhead.jobnJobNum) no-lock

for each ttPartTran BREAK BY ttPartTran.JobNum where (ttPartTran.RowMod = 'A' or ttPartTran.RowMod = 'U' and ttPartTran.TranType = 'MFG-STK' and ttPartTran.WareHouseCode = 'GHD') , each jobhead BREAK BY jobhead.JobNum where jobhead.Company = ttPartTran.Company and jobhead.JobNum = ttPartTran.JobNum and ttPartTran.TranQty (TOTAL BY ttPartTran.TranQty) > jobhead.ProdQty no-lock

for each ttPartTran BREAK BY ttPartTran.JobNum where (ttPartTran.RowMod = 'A' or ttPartTran.RowMod = 'U' and ttPartTran.TranType = 'MFG-STK' and ttPartTran.WareHouseCode = 'GHD') , each jobhead BREAK BY jobhead.JobNum where jobhead.Company = ttPartTran.Company and jobhead.JobNum = ttPartTran.JobNum and (TOTAL BY ttPartTran.TranQty, ttPartTran.TranQty  > jobhead.ProdQty) no-lock

for each ttPartTran no-lock , each JobHead BREAK BY JobHead.Jobnum where (ttPartTran.Company = JobHead.Company and ttPartTran.JobNum = JobHead.JobNum) and ttPartTran.TranQty > jobhead.ProdQty (TOTAL BY JobHead.JobNum) no-lock

for each ttPartTran no-lock , each JobHead BREAK BY JobHead.Jobnum where (ttPartTran.Company = JobHead.Company and ttPartTran.JobNum = JobHead.JobNum) and (TOTAL BY jobhead.jobnum) ttPartTran.TranQty > jobhead.ProdQty no-lock

RE: BPM query

(OP)
I am going to attempt this via the 4GL action in BPM, based on the following code:

DEFINE VARIABLE Total Like ttPartTran.TranQty

for each ttPartTran where (ttPartTran.RowMod = 'A' or ttPartTran.RowMod = 'U' AND ttPartTran.Trantype = 'MFG-STK' AND ttPartTran.WareHouseCode = 'GHD') ,
each jobhead BREAK BY jobhead.JobNum no-lock where jobhead.Company = ttPartTran.Company and jobhead.JobNum = ttPartTran.JobNum:

SUB-TOTAL BY Total
IF Total > jobhead.ProdQty Then
MESSAGE "The received Qty is greater than the Total Job Qty"


Howevever, this is still not correct......does anybody have any suggestions?

RE: BPM query

(OP)
Changed by code to the following but still no luck : -(

DEFINE VARIABLE Total Like ttPartTran.TranQty.

for each ttPartTran where (ttPartTran.RowMod = 'A'
                           or ttPartTran.RowMod = 'U'
                           AND ttPartTran.Trantype = 'MFG-STK'
                           AND ttPartTran.WareHouseCode = 'GHD') ,
    each jobhead NO-LOCK  
    where jobhead.Company = ttPartTran.Company
    and jobhead.JobNum = ttPartTran.JobNum
    BREAK BY jobhead.JobNum:

    ACCUMULATE ttPartTran.TranQty (SUB-TOTAL).

    IF LAST-OF(jobhead.JobNum) THEN
        ASSIGN Total = (ACCUM SUB-TOTAL ttPartTran.TranQty).

    IF Total > jobhead.ProdQty Then
        MESSAGE "The received Qty is greater than the Total Job Qty" .
END.

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close