ABL: "Group By" equivalent

This sounds like it will work. Thanks Rob.



From: vantage@yahoogroups.com [mailto:vantage@yahoogroups.com] On Behalf
Of Rob Bucek
Sent: Thursday, January 24, 2013 12:28 PM
To: vantage@yahoogroups.com
Subject: [Vantage] RE: ABL: "Group By" equivalent





Look at the (break by) function, that may do what you're after if I read
your post correctly..

Ex..

For each jobasmbl where JobAsmbl.Company = LaborDtl.Company and
JobAsmbl.JobNum = LaborDtl.JobNum and JobAsmbl.Parent = parent and
JobAsmbl.AssemblySeq <> 0 no-lock break by jobasmbl.assemblyseq:
RUN lib\UpdateTableBuffer.p(input BUFFER JobAsmbl:HANDLE, 'Number03',1).
count = count + JobAsmbl.Number03.
If Last-OF(JobAsmbl.AssemblySeq) Then DO:

Rob Bucek
Production Control Manager
PH: (715) 284-5376 ext 311
Mobile: (715)896-4832
FAX: (715)284-4084
[cid:1.234354861@...
<mailto:1.234354861%40web65412.mail.ac4.yahoo.com> ]
http://www.dsmfg.com/>
(Click the logo to view our site)http://www.dsmfg.com/>

From: vantage@yahoogroups.com <mailto:vantage%40yahoogroups.com>
[mailto:vantage@yahoogroups.com <mailto:vantage%40yahoogroups.com> ] On
Behalf Of Joe Rojas
Sent: Thursday, January 24, 2013 11:16 AM
To: vantage@yahoogroups.com <mailto:vantage%40yahoogroups.com>
Subject: [Vantage] ABL: "Group By" equivalent

Hello,

I'm want to iterate through the ShipDtl records for a shipment that may
contain several line and may be consolidating multiple order on the
shipment.

I only want to run a code block one time for each order number.

Some like the following will run my code for each shipdtl record:

For each shipdtl where shipdtl.company = shiphead.company and
shipdtl.packnum = shiphead.packnum:

End.

But if my shipment has 20 lines and consolidates 2 orders, I want my
code to only run two times. One for each order.

If there a way to do that without using variables to track the change in
order number?

Joe Rojas | Director of Information Technology | Mats Inc
dir: 781-573-0291 | cell: 781-408-9278 | fax: 781-232-5191
jrojas@... <mailto:jrojas%40matsinc.com> | www.matsinc.com Ask
us about our clean, green and beautiful matting and flooring

This message is intended only for the individual named. If you are not
the named addressee you should not disseminate, distribute or copy this
e-mail. Please notify the sender immediately by e-mail if you have
received this e-mail by mistake. Please note that any views or opinions
presented in this email are solely those of the author and do not
necessarily represent those of the company.

[Non-text portions of this message have been removed]

[Non-text portions of this message have been removed]










Joe Rojas | Director of Information Technology | Mats Inc
dir: 781-573-0291 | cell: 781-408-9278 | fax: 781-232-5191
jrojas@... | www.matsinc.com Ask us about our clean, green and beautiful matting and flooring


This message is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. Please notify the sender immediately by e-mail if you have received this e-mail by mistake. Please note that any views or opinions presented in this email are solely those of the author and do not necessarily represent those of the company.


[Non-text portions of this message have been removed]
Hello,



I'm want to iterate through the ShipDtl records for a shipment that may
contain several line and may be consolidating multiple order on the
shipment.

I only want to run a code block one time for each order number.

Some like the following will run my code for each shipdtl record:

For each shipdtl where shipdtl.company = shiphead.company and
shipdtl.packnum = shiphead.packnum:

<run some code>

End.



But if my shipment has 20 lines and consolidates 2 orders, I want my
code to only run two times. One for each order.



If there a way to do that without using variables to track the change in
order number?








Joe Rojas | Director of Information Technology | Mats Inc
dir: 781-573-0291 | cell: 781-408-9278 | fax: 781-232-5191
jrojas@... | www.matsinc.com Ask us about our clean, green and beautiful matting and flooring


This message is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. Please notify the sender immediately by e-mail if you have received this e-mail by mistake. Please note that any views or opinions presented in this email are solely those of the author and do not necessarily represent those of the company.


[Non-text portions of this message have been removed]
Look at the (break by) function, that may do what you're after if I read your post correctly..

Ex..

For each jobasmbl where JobAsmbl.Company = LaborDtl.Company and JobAsmbl.JobNum = LaborDtl.JobNum and JobAsmbl.Parent = parent and JobAsmbl.AssemblySeq <> 0 no-lock break by jobasmbl.assemblyseq:
RUN lib\UpdateTableBuffer.p(input BUFFER JobAsmbl:HANDLE, 'Number03',1).
count = count + JobAsmbl.Number03.
If Last-OF(JobAsmbl.AssemblySeq) Then DO:


Rob Bucek
Production Control Manager
PH: (715) 284-5376 ext 311
Mobile: (715)896-4832
FAX: (715)284-4084
[cid:1.234354861@...]<http://www.dsmfg.com/>
(Click the logo to view our site)<http://www.dsmfg.com/>

From: vantage@yahoogroups.com [mailto:vantage@yahoogroups.com] On Behalf Of Joe Rojas
Sent: Thursday, January 24, 2013 11:16 AM
To: vantage@yahoogroups.com
Subject: [Vantage] ABL: "Group By" equivalent



Hello,

I'm want to iterate through the ShipDtl records for a shipment that may
contain several line and may be consolidating multiple order on the
shipment.

I only want to run a code block one time for each order number.

Some like the following will run my code for each shipdtl record:

For each shipdtl where shipdtl.company = shiphead.company and
shipdtl.packnum = shiphead.packnum:



End.

But if my shipment has 20 lines and consolidates 2 orders, I want my
code to only run two times. One for each order.

If there a way to do that without using variables to track the change in
order number?





Joe Rojas | Director of Information Technology | Mats Inc
dir: 781-573-0291 | cell: 781-408-9278 | fax: 781-232-5191
jrojas@...<mailto:jrojas%40matsinc.com> | www.matsinc.com Ask us about our clean, green and beautiful matting and flooring

This message is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. Please notify the sender immediately by e-mail if you have received this e-mail by mistake. Please note that any views or opinions presented in this email are solely those of the author and do not necessarily represent those of the company.

[Non-text portions of this message have been removed]



[Non-text portions of this message have been removed]