Help with ABL Code Please

Jose,

Thanks for another great tip. I was able to use the Message statement to
debug my ABL.

Mike

-----Original Message-----
From: vantage@yahoogroups.com [mailto:vantage@yahoogroups.com] On Behalf Of
Jose Gomez
Sent: Thursday, June 21, 2012 9:43 AM
To: vantage@yahoogroups.com
Subject: Re: [Vantage] Help with ABL Code Please.

On the for what is Worth Category if you type anywhere in your ABL

Message 'YOUR MESSAGE HERE' + STRING(YourTable.Var).

This will be writter to \\Epicor\Server\Logs\YourServer.Log

*Jose C Gomez*
*Software Engineer*
*
*
*checkout my new blog <http://www.usdoingstuff.com> *
*
*T: 904.469.1524 mobile
E: jose@...
http://www.josecgomez.com
<http://www.linkedin.com/in/josecgomez> <http://www.facebook.com/josegomez>
<http://www.google.com/profiles/jose.gomez> <http://www.twitter.com/joc85>
<http://www.josecgomez.com/professional-resume/>
<http://www.josecgomez.com/feed/>
<http://www.usdoingstuff.com>

*Quis custodiet ipsos custodes?*



On Thu, Jun 21, 2012 at 9:36 AM, Rob Bucek <rbucek@...> wrote:

> **
>
>
> Typically jobhead.partnum would contain the 'end item',
> jobasmbl.partnum would be each make direct assembly.
>
> Rob Bucek
> Production Control Manager
> PH: (715) 284-5376 ext 311
> Mobile: (715)896-0590
> FAX: (715)284-4084
> [Description: 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 Mike Numbers
> Sent: Thursday, June 21, 2012 8:30 AM
> To: vantage@yahoogroups.com
> Subject: RE: [Vantage] Help with ABL Code Please.
>
>
> You're right. JobOper Partnum does not match JobHead. Thanks for the
> tip on Jose's blog on debugging ABL code.
>
> Guess I need to figure out new logic to find all jobs for a partnum.
>
> Thanks again.
>
> Mike
>
> From: vantage@yahoogroups.com<mailto:vantage%40yahoogroups.com> [mailto:
> vantage@yahoogroups.com<mailto:vantage%40yahoogroups.com>] On Behalf
> Of
>
> Ted Koch
> Sent: Wednesday, June 20, 2012 5:16 PM
> To: vantage@yahoogroups.com<mailto:vantage%40yahoogroups.com>
>
> Subject: Re: [Vantage] Help with ABL Code Please.
>
> I could be wrong but I think you're only going to get a part number in
> JobOper.PartNum if it is a subcontract operation, and depending how
> you are structuring your jobs I dont know if your jobhead.partnum will
> equal joboper.partnum.
>
> My guess is its not doing anything because nothing matches the
> criteria in your second for each loop. Did you create a BPM and verify
> that a criteria like this returns anything? You can also debug your
> ABL code. Here is an example from Jose's blog
>
> http://www.usdoingstuff.com/2011/06/08/writing-to-a-file-from-progress
> -abl4g
> l/ (thanks Jose).
>
> Hope that helps,
>
> -Ted
>
> ________________________________
> From: mike.numbers <mnumbers@...<mailto:mnumbers%40cignys.com>
> <mailto:mnumbers%40cignys.com> >
> To: vantage@yahoogroups.com<mailto:vantage%40yahoogroups.com> <mailto:
> vantage%40yahoogroups.com>
>
> Sent: Wednesday, June 20, 2012 2:20 PM
> Subject: [Vantage] Help with ABL Code Please.
>
> This is my first time with ABL code with any complexity. The code
> validates but my results are not there. I have this code attached
> PreProcessing Method Directive with Labor.Update. I know it runs
> because I put an informational action after this action and it
> appears. The code is supposed to get the part number from the Jobhead,
> then read all completed operations for this part and operation and
> then calculate a new estprodhr and estsethr.
> I save the previous values in partopr.number01 and number02.
> Epicor 9.04.507a
> Any help in showing me where I screwed up would be appreciated.
> Below is my code.
> TIA
> Mike
> -----------------------------------------------------
>
> define variable AveSet LIKE PartOpr.EstSetHours.
> define variable AveProd LIKE PartOpr.EstProdHours.
>
> for each JobHead where JobHead.JobNum = ttLaborDtl.JobNum no-lock.
> if available JobHead then do:
> /* need JobHead to get Partnum */
> for each JobOper where JobOper.PartNum = JobHead.PartNum and
> JobOper.AssemblySeq = ttLaborDtl.AssemblySeq and JobOper.OprSeq =
> ttLaborDtl.OprSeq and JobOper.OpComplete = True no-lock.
>
> /* accumulate totals for each completed job for this operation */
> ACCUMULATE JobOper.QtyCompleted (SUB-TOTAL).
> Accumulate JobOper.ActProdHours (SUB-TOTAL).
> Accumulate JobOper.ActSetupHours (SUB-TOTAL COUNT).
> end.
>
> /* calculate averages */
> AveProd = (Accum Sub-Total JobOper.ActProdHours) / (Accum Sub-Total
> JobOper.QtyCompleted).
> AveSet = (Accum Sub-Total JobOper.ActSetupHours) / (Accum Count
> JobOper.ActSetupHours).
>
> /* get PartOpr to update new values */ find PartOpr WHERE
> PartOpr.PartNum = JobHead.PartNum and PartOpr.OprSeq =
> ttLaborDtl.OprSeq and PartOpr.RevisionNum = JobHead.RevisionNum.
> Assign
> /* save last value*/
> PartOpr.Number01 = PartOpr.EstProdHours
> PartOpr.Number02 = PartOpr.EstSetHours
> /* move in new values */
> PartOpr.EstProdHours = AveProd
> PartOpr.EstSetHours = AveSet.
>
> /* update values */
> UPDATE
> PartOpr.Number01
> PartOpr.Number02
> PartOpr.EstProdHours
> PartOpr.EstSetHours.
>
> end.
> end.
>
> ------------------------------------
>
> Useful links for the Yahoo!Groups Vantage Board are: ( Note: You must
> have already linked your email address to a yahoo id to enable access.
> )
> (1) To access the Files Section of our Yahoo!Group for Report Builder
> and Crystal Reports and other 'goodies', please goto:
> http://groups.yahoo.com/group/vantage/files/.<
> http://groups.yahoo.com/group/vantage/files/>
> <http://groups.yahoo.com/group/vantage/files/>
> (2) To search through old msg's goto:
> http://groups.yahoo.com/group/vantage/messages
> (3) To view links to Vendors that provide Vantage services goto:
> http://groups.yahoo.com/group/vantage/linksYahoo! Groups Links
>
> [Non-text portions of this message have been removed]
>
> [Non-text portions of this message have been removed]
>
> [Non-text portions of this message have been removed]
>
>
>


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



------------------------------------

Useful links for the Yahoo!Groups Vantage Board are: ( Note: You must have
already linked your email address to a yahoo id to enable access. )
(1) To access the Files Section of our Yahoo!Group for Report Builder and
Crystal Reports and other 'goodies', please goto:
http://groups.yahoo.com/group/vantage/files/.
(2) To search through old msg's goto:
http://groups.yahoo.com/group/vantage/messages
(3) To view links to Vendors that provide Vantage services goto:
http://groups.yahoo.com/group/vantage/linksYahoo! Groups Links
This is my first time with ABL code with any complexity. The code validates but my results are not there. I have this code attached PreProcessing Method Directive with Labor.Update. I know it runs because I put an informational action after this action and it appears. The code is supposed to get the part number from the Jobhead, then read all completed operations for this part and operation and then calculate a new estprodhr and estsethr. I save the previous values in partopr.number01 and number02.
Epicor 9.04.507a
Any help in showing me where I screwed up would be appreciated.
Below is my code.
TIA
Mike
-----------------------------------------------------

define variable AveSet LIKE PartOpr.EstSetHours.
define variable AveProd LIKE PartOpr.EstProdHours.

for each JobHead where JobHead.JobNum = ttLaborDtl.JobNum no-lock.
if available JobHead then do:
/* need JobHead to get Partnum */
for each JobOper where JobOper.PartNum = JobHead.PartNum and JobOper.AssemblySeq = ttLaborDtl.AssemblySeq and JobOper.OprSeq = ttLaborDtl.OprSeq and JobOper.OpComplete = True no-lock.

/* accumulate totals for each completed job for this operation */
ACCUMULATE JobOper.QtyCompleted (SUB-TOTAL).
Accumulate JobOper.ActProdHours (SUB-TOTAL).
Accumulate JobOper.ActSetupHours (SUB-TOTAL COUNT).
end.

/* calculate averages */
AveProd = (Accum Sub-Total JobOper.ActProdHours) / (Accum Sub-Total JobOper.QtyCompleted).
AveSet = (Accum Sub-Total JobOper.ActSetupHours) / (Accum Count JobOper.ActSetupHours).

/* get PartOpr to update new values */
find PartOpr WHERE PartOpr.PartNum = JobHead.PartNum and PartOpr.OprSeq = ttLaborDtl.OprSeq and PartOpr.RevisionNum = JobHead.RevisionNum.
Assign
/* save last value*/
PartOpr.Number01 = PartOpr.EstProdHours
PartOpr.Number02 = PartOpr.EstSetHours
/* move in new values */
PartOpr.EstProdHours = AveProd
PartOpr.EstSetHours = AveSet.

/* update values */
UPDATE
PartOpr.Number01
PartOpr.Number02
PartOpr.EstProdHours
PartOpr.EstSetHours.

end.
end.
I could be wrong but I think you're only going to get a part number in JobOper.PartNum if it is a subcontract operation, and depending how you are structuring your jobs I dont know if your jobhead.partnum will equal joboper.partnum.

My guess is its not doing anything because nothing matches the criteria in your second for each loop. Did you create a BPM and verify that a criteria like this returns anything? You can also debug your ABL code. Here is an example from Jose's blog http://www.usdoingstuff.com/2011/06/08/writing-to-a-file-from-progress-abl4gl/ (thanks Jose).

Hope that helps,

-Ted



________________________________
From: mike.numbers <mnumbers@...>
To: vantage@yahoogroups.com
Sent: Wednesday, June 20, 2012 2:20 PM
Subject: [Vantage] Help with ABL Code Please.

This is my first time with ABL code with any complexity. The code validates but my results are not there. I have this code attached PreProcessing Method Directive with Labor.Update. I know it runs because I put an informational action after this action and it appears. The code is supposed to get the part number from the Jobhead, then read all completed operations for this part and operation and then calculate a new estprodhr and estsethr. I save the previous values in partopr.number01 and number02.
Epicor 9.04.507a
Any help in showing me where I screwed up would be appreciated.
Below is my code.
TIA
Mike
-----------------------------------------------------

define variable AveSet LIKE PartOpr.EstSetHours.
define variable AveProd LIKE PartOpr.EstProdHours.

for each JobHead where JobHead.JobNum = ttLaborDtl.JobNum no-lock.
if available JobHead then do:
/* need JobHead to get Partnum */
for each JobOper where JobOper.PartNum = JobHead.PartNum and JobOper.AssemblySeq = ttLaborDtl.AssemblySeq and JobOper.OprSeq = ttLaborDtl.OprSeq and JobOper.OpComplete = True no-lock.

/* accumulate totals for each completed job for this operation */
   ACCUMULATE JobOper.QtyCompleted (SUB-TOTAL).
   Accumulate JobOper.ActProdHours (SUB-TOTAL).
   Accumulate JobOper.ActSetupHours (SUB-TOTAL COUNT).
end.

/* calculate averages */
AveProd = (Accum Sub-Total JobOper.ActProdHours) / (Accum Sub-Total JobOper.QtyCompleted).
AveSet = (Accum Sub-Total JobOper.ActSetupHours) / (Accum Count JobOper.ActSetupHours).

/* get PartOpr to update new values */
find PartOpr WHERE PartOpr.PartNum = JobHead.PartNum and PartOpr.OprSeq = ttLaborDtl.OprSeq and PartOpr.RevisionNum = JobHead.RevisionNum.
Assign
/* save last value*/Â Â Â
   PartOpr.Number01 = PartOpr.EstProdHours
   PartOpr.Number02 = PartOpr.EstSetHours
/* move in new values */
   PartOpr.EstProdHours = AveProd
   PartOpr.EstSetHours = AveSet.

/* update values */
UPDATE
   PartOpr.Number01
   PartOpr.Number02
   PartOpr.EstProdHours
   PartOpr.EstSetHours.

end.
end.



------------------------------------

Useful links for the Yahoo!Groups Vantage Board are: ( Note:Â You must have already linked your email address to a yahoo id to enable access. )
(1) To access the Files Section of our Yahoo!Group for Report Builder and Crystal Reports and other 'goodies', please goto: http://groups.yahoo.com/group/vantage/files/.%c2%a0
(2) To search through old msg's goto: http://groups.yahoo.com/group/vantage/messages
(3) To view links to Vendors that provide Vantage services goto: http://groups.yahoo.com/group/vantage/linksYahoo! Groups Links



[Non-text portions of this message have been removed]
Did you create a BPM and verify that a criteria like this returns anything?

Should read,

Did you create a BAQ and verify that a criteria like this returns anything?


________________________________
From: Ted Koch <tkoch77@...>
To: "vantage@yahoogroups.com" <vantage@yahoogroups.com>
Sent: Wednesday, June 20, 2012 5:15 PM
Subject: Re: [Vantage] Help with ABL Code Please.

I could be wrong but I think you're only going to get a part number in JobOper.PartNum if it is a subcontract operation, and depending how you are structuring your jobs I dont know if your jobhead.partnum will equal joboper.partnum.

My guess is its not doing anything because nothing matches the criteria in your second for each loop. Did you create a BPM and verify that a criteria like this returns anything? You can also debug your ABL code. Here is an example from Jose's blog http://www.usdoingstuff.com/2011/06/08/writing-to-a-file-from-progress-abl4gl/ (thanks Jose).

Hope that helps,

-Ted



________________________________
From: mike.numbers <mnumbers@...>
To: vantage@yahoogroups.com
Sent: Wednesday, June 20, 2012 2:20 PM
Subject: [Vantage] Help with ABL Code Please.

This is my first time with ABL code with any complexity. The code validates but my results are not there. I have this code attached PreProcessing Method Directive with Labor.Update. I know it runs because I put an informational action after this action and it appears. The code is supposed to get the part number from the Jobhead, then read all completed operations for this part and operation and then calculate a new estprodhr and estsethr. I save the previous values in partopr.number01 and number02.
Epicor 9.04.507a
Any help in showing me where I screwed up would be appreciated.
Below is my code.
TIA
Mike
-----------------------------------------------------

define variable AveSet LIKE PartOpr.EstSetHours.
define variable AveProd LIKE PartOpr.EstProdHours.

for each JobHead where JobHead.JobNum = ttLaborDtl.JobNum no-lock.
if available JobHead then do:
/* need JobHead to get Partnum */
for each JobOper where JobOper.PartNum = JobHead.PartNum and JobOper.AssemblySeq = ttLaborDtl.AssemblySeq and JobOper.OprSeq = ttLaborDtl.OprSeq and JobOper.OpComplete = True no-lock.

/* accumulate totals for each completed job for this operation */
   ACCUMULATE JobOper.QtyCompleted (SUB-TOTAL).
   Accumulate JobOper.ActProdHours (SUB-TOTAL).
   Accumulate JobOper.ActSetupHours (SUB-TOTAL COUNT).
end.

/* calculate averages */
AveProd = (Accum Sub-Total JobOper.ActProdHours) / (Accum Sub-Total JobOper.QtyCompleted).
AveSet = (Accum Sub-Total JobOper.ActSetupHours) / (Accum Count JobOper.ActSetupHours).

/* get PartOpr to update new values */
find PartOpr WHERE PartOpr.PartNum = JobHead.PartNum and PartOpr.OprSeq = ttLaborDtl.OprSeq and PartOpr.RevisionNum = JobHead.RevisionNum.
Assign
/* save last value*/Â Â Â
   PartOpr.Number01 = PartOpr.EstProdHours
   PartOpr.Number02 = PartOpr.EstSetHours
/* move in new values */
   PartOpr.EstProdHours = AveProd
   PartOpr.EstSetHours = AveSet.

/* update values */
UPDATE
   PartOpr.Number01
   PartOpr.Number02
   PartOpr.EstProdHours
   PartOpr.EstSetHours.

end.
end.



------------------------------------

Useful links for the Yahoo!Groups Vantage Board are: ( Note:Â You must have already linked your email address to a yahoo id to enable access. )
(1) To access the Files Section of our Yahoo!Group for Report Builder and Crystal Reports and other 'goodies', please goto: http://groups.yahoo.com/group/vantage/files/.%c2%a0
(2) To search through old msg's goto: http://groups.yahoo.com/group/vantage/messages
(3) To view links to Vendors that provide Vantage services goto: http://groups.yahoo.com/group/vantage/linksYahoo! Groups Links



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



------------------------------------

Useful links for the Yahoo!Groups Vantage Board are: ( Note:Â You must have already linked your email address to a yahoo id to enable access. )
(1) To access the Files Section of our Yahoo!Group for Report Builder and Crystal Reports and other 'goodies', please goto: http://groups.yahoo.com/group/vantage/files/.%c2%a0
(2) To search through old msg's goto: http://groups.yahoo.com/group/vantage/messages
(3) To view links to Vendors that provide Vantage services goto: http://groups.yahoo.com/group/vantage/linksYahoo! Groups Links



[Non-text portions of this message have been removed]
You're right. JobOper Partnum does not match JobHead. Thanks for the tip
on Jose's blog on debugging ABL code.

Guess I need to figure out new logic to find all jobs for a partnum.



Thanks again.

Mike



From: vantage@yahoogroups.com [mailto:vantage@yahoogroups.com] On Behalf Of
Ted Koch
Sent: Wednesday, June 20, 2012 5:16 PM
To: vantage@yahoogroups.com
Subject: Re: [Vantage] Help with ABL Code Please.





I could be wrong but I think you're only going to get a part number in
JobOper.PartNum if it is a subcontract operation, and depending how you are
structuring your jobs I dont know if your jobhead.partnum will equal
joboper.partnum.

My guess is its not doing anything because nothing matches the criteria in
your second for each loop. Did you create a BPM and verify that a criteria
like this returns anything? You can also debug your ABL code. Here is an
example from Jose's blog
http://www.usdoingstuff.com/2011/06/08/writing-to-a-file-from-progress-abl4g
l/ (thanks Jose).

Hope that helps,

-Ted

________________________________
From: mike.numbers <mnumbers@... <mailto:mnumbers%40cignys.com> >
To: vantage@yahoogroups.com <mailto:vantage%40yahoogroups.com>
Sent: Wednesday, June 20, 2012 2:20 PM
Subject: [Vantage] Help with ABL Code Please.

This is my first time with ABL code with any complexity. The code validates
but my results are not there. I have this code attached PreProcessing
Method Directive with Labor.Update. I know it runs because I put an
informational action after this action and it appears. The code is supposed
to get the part number from the Jobhead, then read all completed operations
for this part and operation and then calculate a new estprodhr and estsethr.
I save the previous values in partopr.number01 and number02.
Epicor 9.04.507a
Any help in showing me where I screwed up would be appreciated.
Below is my code.
TIA
Mike
-----------------------------------------------------

define variable AveSet LIKE PartOpr.EstSetHours.
define variable AveProd LIKE PartOpr.EstProdHours.

for each JobHead where JobHead.JobNum = ttLaborDtl.JobNum no-lock.
if available JobHead then do:
/* need JobHead to get Partnum */
for each JobOper where JobOper.PartNum = JobHead.PartNum and
JobOper.AssemblySeq = ttLaborDtl.AssemblySeq and JobOper.OprSeq =
ttLaborDtl.OprSeq and JobOper.OpComplete = True no-lock.

/* accumulate totals for each completed job for this operation */
ACCUMULATE JobOper.QtyCompleted (SUB-TOTAL).
Accumulate JobOper.ActProdHours (SUB-TOTAL).
Accumulate JobOper.ActSetupHours (SUB-TOTAL COUNT).
end.

/* calculate averages */
AveProd = (Accum Sub-Total JobOper.ActProdHours) / (Accum Sub-Total
JobOper.QtyCompleted).
AveSet = (Accum Sub-Total JobOper.ActSetupHours) / (Accum Count
JobOper.ActSetupHours).

/* get PartOpr to update new values */
find PartOpr WHERE PartOpr.PartNum = JobHead.PartNum and PartOpr.OprSeq =
ttLaborDtl.OprSeq and PartOpr.RevisionNum = JobHead.RevisionNum.
Assign
/* save last value*/
PartOpr.Number01 = PartOpr.EstProdHours
PartOpr.Number02 = PartOpr.EstSetHours
/* move in new values */
PartOpr.EstProdHours = AveProd
PartOpr.EstSetHours = AveSet.

/* update values */
UPDATE
PartOpr.Number01
PartOpr.Number02
PartOpr.EstProdHours
PartOpr.EstSetHours.

end.
end.

------------------------------------

Useful links for the Yahoo!Groups Vantage Board are: ( Note: You must have
already linked your email address to a yahoo id to enable access. )
(1) To access the Files Section of our Yahoo!Group for Report Builder and
Crystal Reports and other 'goodies', please goto:
http://groups.yahoo.com/group/vantage/files/.
<http://groups.yahoo.com/group/vantage/files/>
(2) To search through old msg's goto:
http://groups.yahoo.com/group/vantage/messages
(3) To view links to Vendors that provide Vantage services goto:
http://groups.yahoo.com/group/vantage/linksYahoo! Groups Links

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





[Non-text portions of this message have been removed]
Typically jobhead.partnum would contain the 'end item', jobasmbl.partnum would be each make direct assembly.

Rob Bucek
Production Control Manager
PH: (715) 284-5376 ext 311
Mobile: (715)896-0590
FAX: (715)284-4084
[Description: 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 Mike Numbers
Sent: Thursday, June 21, 2012 8:30 AM
To: vantage@yahoogroups.com
Subject: RE: [Vantage] Help with ABL Code Please.



You're right. JobOper Partnum does not match JobHead. Thanks for the tip
on Jose's blog on debugging ABL code.

Guess I need to figure out new logic to find all jobs for a partnum.

Thanks again.

Mike

From: vantage@yahoogroups.com<mailto:vantage%40yahoogroups.com> [mailto:vantage@yahoogroups.com<mailto:vantage%40yahoogroups.com>] On Behalf Of
Ted Koch
Sent: Wednesday, June 20, 2012 5:16 PM
To: vantage@yahoogroups.com<mailto:vantage%40yahoogroups.com>
Subject: Re: [Vantage] Help with ABL Code Please.

I could be wrong but I think you're only going to get a part number in
JobOper.PartNum if it is a subcontract operation, and depending how you are
structuring your jobs I dont know if your jobhead.partnum will equal
joboper.partnum.

My guess is its not doing anything because nothing matches the criteria in
your second for each loop. Did you create a BPM and verify that a criteria
like this returns anything? You can also debug your ABL code. Here is an
example from Jose's blog
http://www.usdoingstuff.com/2011/06/08/writing-to-a-file-from-progress-abl4g
l/ (thanks Jose).

Hope that helps,

-Ted

________________________________
From: mike.numbers <mnumbers@...<mailto:mnumbers%40cignys.com> <mailto:mnumbers%40cignys.com> >
To: vantage@yahoogroups.com<mailto:vantage%40yahoogroups.com> <mailto:vantage%40yahoogroups.com>
Sent: Wednesday, June 20, 2012 2:20 PM
Subject: [Vantage] Help with ABL Code Please.

This is my first time with ABL code with any complexity. The code validates
but my results are not there. I have this code attached PreProcessing
Method Directive with Labor.Update. I know it runs because I put an
informational action after this action and it appears. The code is supposed
to get the part number from the Jobhead, then read all completed operations
for this part and operation and then calculate a new estprodhr and estsethr.
I save the previous values in partopr.number01 and number02.
Epicor 9.04.507a
Any help in showing me where I screwed up would be appreciated.
Below is my code.
TIA
Mike
-----------------------------------------------------

define variable AveSet LIKE PartOpr.EstSetHours.
define variable AveProd LIKE PartOpr.EstProdHours.

for each JobHead where JobHead.JobNum = ttLaborDtl.JobNum no-lock.
if available JobHead then do:
/* need JobHead to get Partnum */
for each JobOper where JobOper.PartNum = JobHead.PartNum and
JobOper.AssemblySeq = ttLaborDtl.AssemblySeq and JobOper.OprSeq =
ttLaborDtl.OprSeq and JobOper.OpComplete = True no-lock.

/* accumulate totals for each completed job for this operation */
ACCUMULATE JobOper.QtyCompleted (SUB-TOTAL).
Accumulate JobOper.ActProdHours (SUB-TOTAL).
Accumulate JobOper.ActSetupHours (SUB-TOTAL COUNT).
end.

/* calculate averages */
AveProd = (Accum Sub-Total JobOper.ActProdHours) / (Accum Sub-Total
JobOper.QtyCompleted).
AveSet = (Accum Sub-Total JobOper.ActSetupHours) / (Accum Count
JobOper.ActSetupHours).

/* get PartOpr to update new values */
find PartOpr WHERE PartOpr.PartNum = JobHead.PartNum and PartOpr.OprSeq =
ttLaborDtl.OprSeq and PartOpr.RevisionNum = JobHead.RevisionNum.
Assign
/* save last value*/
PartOpr.Number01 = PartOpr.EstProdHours
PartOpr.Number02 = PartOpr.EstSetHours
/* move in new values */
PartOpr.EstProdHours = AveProd
PartOpr.EstSetHours = AveSet.

/* update values */
UPDATE
PartOpr.Number01
PartOpr.Number02
PartOpr.EstProdHours
PartOpr.EstSetHours.

end.
end.

------------------------------------

Useful links for the Yahoo!Groups Vantage Board are: ( Note: You must have
already linked your email address to a yahoo id to enable access. )
(1) To access the Files Section of our Yahoo!Group for Report Builder and
Crystal Reports and other 'goodies', please goto:
http://groups.yahoo.com/group/vantage/files/.<http://groups.yahoo.com/group/vantage/files/>
<http://groups.yahoo.com/group/vantage/files/>
(2) To search through old msg's goto:
http://groups.yahoo.com/group/vantage/messages
(3) To view links to Vendors that provide Vantage services goto:
http://groups.yahoo.com/group/vantage/linksYahoo! Groups Links

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

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



[Non-text portions of this message have been removed]
On the for what is Worth Category if you type anywhere in your ABL

Message 'YOUR MESSAGE HERE' + STRING(YourTable.Var).

This will be writter to \\Epicor\Server\Logs\YourServer.Log

*Jose C Gomez*
*Software Engineer*
*
*
*checkout my new blog <http://www.usdoingstuff.com> *
*
*T: 904.469.1524 mobile
E: jose@...
http://www.josecgomez.com
<http://www.linkedin.com/in/josecgomez> <http://www.facebook.com/josegomez>
<http://www.google.com/profiles/jose.gomez> <http://www.twitter.com/joc85>
<http://www.josecgomez.com/professional-resume/>
<http://www.josecgomez.com/feed/>
<http://www.usdoingstuff.com>

*Quis custodiet ipsos custodes?*



On Thu, Jun 21, 2012 at 9:36 AM, Rob Bucek <rbucek@...> wrote:

> **
>
>
> Typically jobhead.partnum would contain the 'end item', jobasmbl.partnum
> would be each make direct assembly.
>
> Rob Bucek
> Production Control Manager
> PH: (715) 284-5376 ext 311
> Mobile: (715)896-0590
> FAX: (715)284-4084
> [Description: 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 Mike Numbers
> Sent: Thursday, June 21, 2012 8:30 AM
> To: vantage@yahoogroups.com
> Subject: RE: [Vantage] Help with ABL Code Please.
>
>
> You're right. JobOper Partnum does not match JobHead. Thanks for the tip
> on Jose's blog on debugging ABL code.
>
> Guess I need to figure out new logic to find all jobs for a partnum.
>
> Thanks again.
>
> Mike
>
> From: vantage@yahoogroups.com<mailto:vantage%40yahoogroups.com> [mailto:
> vantage@yahoogroups.com<mailto:vantage%40yahoogroups.com>] On Behalf Of
>
> Ted Koch
> Sent: Wednesday, June 20, 2012 5:16 PM
> To: vantage@yahoogroups.com<mailto:vantage%40yahoogroups.com>
>
> Subject: Re: [Vantage] Help with ABL Code Please.
>
> I could be wrong but I think you're only going to get a part number in
> JobOper.PartNum if it is a subcontract operation, and depending how you are
> structuring your jobs I dont know if your jobhead.partnum will equal
> joboper.partnum.
>
> My guess is its not doing anything because nothing matches the criteria in
> your second for each loop. Did you create a BPM and verify that a criteria
> like this returns anything? You can also debug your ABL code. Here is an
> example from Jose's blog
>
> http://www.usdoingstuff.com/2011/06/08/writing-to-a-file-from-progress-abl4g
> l/ (thanks Jose).
>
> Hope that helps,
>
> -Ted
>
> ________________________________
> From: mike.numbers <mnumbers@...<mailto:mnumbers%40cignys.com>
> <mailto:mnumbers%40cignys.com> >
> To: vantage@yahoogroups.com<mailto:vantage%40yahoogroups.com> <mailto:
> vantage%40yahoogroups.com>
>
> Sent: Wednesday, June 20, 2012 2:20 PM
> Subject: [Vantage] Help with ABL Code Please.
>
> This is my first time with ABL code with any complexity. The code validates
> but my results are not there. I have this code attached PreProcessing
> Method Directive with Labor.Update. I know it runs because I put an
> informational action after this action and it appears. The code is supposed
> to get the part number from the Jobhead, then read all completed operations
> for this part and operation and then calculate a new estprodhr and
> estsethr.
> I save the previous values in partopr.number01 and number02.
> Epicor 9.04.507a
> Any help in showing me where I screwed up would be appreciated.
> Below is my code.
> TIA
> Mike
> -----------------------------------------------------
>
> define variable AveSet LIKE PartOpr.EstSetHours.
> define variable AveProd LIKE PartOpr.EstProdHours.
>
> for each JobHead where JobHead.JobNum = ttLaborDtl.JobNum no-lock.
> if available JobHead then do:
> /* need JobHead to get Partnum */
> for each JobOper where JobOper.PartNum = JobHead.PartNum and
> JobOper.AssemblySeq = ttLaborDtl.AssemblySeq and JobOper.OprSeq =
> ttLaborDtl.OprSeq and JobOper.OpComplete = True no-lock.
>
> /* accumulate totals for each completed job for this operation */
> ACCUMULATE JobOper.QtyCompleted (SUB-TOTAL).
> Accumulate JobOper.ActProdHours (SUB-TOTAL).
> Accumulate JobOper.ActSetupHours (SUB-TOTAL COUNT).
> end.
>
> /* calculate averages */
> AveProd = (Accum Sub-Total JobOper.ActProdHours) / (Accum Sub-Total
> JobOper.QtyCompleted).
> AveSet = (Accum Sub-Total JobOper.ActSetupHours) / (Accum Count
> JobOper.ActSetupHours).
>
> /* get PartOpr to update new values */
> find PartOpr WHERE PartOpr.PartNum = JobHead.PartNum and PartOpr.OprSeq =
> ttLaborDtl.OprSeq and PartOpr.RevisionNum = JobHead.RevisionNum.
> Assign
> /* save last value*/
> PartOpr.Number01 = PartOpr.EstProdHours
> PartOpr.Number02 = PartOpr.EstSetHours
> /* move in new values */
> PartOpr.EstProdHours = AveProd
> PartOpr.EstSetHours = AveSet.
>
> /* update values */
> UPDATE
> PartOpr.Number01
> PartOpr.Number02
> PartOpr.EstProdHours
> PartOpr.EstSetHours.
>
> end.
> end.
>
> ------------------------------------
>
> Useful links for the Yahoo!Groups Vantage Board are: ( Note: You must have
> already linked your email address to a yahoo id to enable access. )
> (1) To access the Files Section of our Yahoo!Group for Report Builder and
> Crystal Reports and other 'goodies', please goto:
> http://groups.yahoo.com/group/vantage/files/.<
> http://groups.yahoo.com/group/vantage/files/>
> <http://groups.yahoo.com/group/vantage/files/>
> (2) To search through old msg's goto:
> http://groups.yahoo.com/group/vantage/messages
> (3) To view links to Vendors that provide Vantage services goto:
> http://groups.yahoo.com/group/vantage/linksYahoo! Groups Links
>
> [Non-text portions of this message have been removed]
>
> [Non-text portions of this message have been removed]
>
> [Non-text portions of this message have been removed]
>
>
>


[Non-text portions of this message have been removed]
Useful tip Jose, didn't know about that.



________________________________
From: Jose Gomez <jose@...>
To: vantage@yahoogroups.com
Sent: Thursday, June 21, 2012 9:42 AM
Subject: Re: [Vantage] Help with ABL Code Please.

On the for what is Worth Category if you type anywhere in your ABL

Message 'YOUR MESSAGE HERE' + STRING(YourTable.Var).

This will be writter to \\Epicor\Server\Logs\YourServer.Log

*Jose C Gomez*
*Software Engineer*
*
*
*checkout my new blog <http://www.usdoingstuff.com> *
*
*T: 904.469.1524 mobile
E: jose@...
http://www.josecgomez.com
<http://www.linkedin.com/in/josecgomez>Â <http://www.facebook.com/josegomez>
 <http://www.google.com/profiles/jose.gomez> <http://www.twitter.com/joc85>
 <http://www.josecgomez.com/professional-resume/>
<http://www.josecgomez.com/feed/>
 <http://www.usdoingstuff.com>

*Quis custodiet ipsos custodes?*



On Thu, Jun 21, 2012 at 9:36 AM, Rob Bucek <rbucek@...> wrote:

> **
>
>
> Typically jobhead.partnum would contain the 'end item', jobasmbl.partnum
> would be each make direct assembly.
>
> Rob Bucek
> Production Control Manager
> PH: (715) 284-5376 ext 311
> Mobile: (715)896-0590
> FAX: (715)284-4084
> [Description: 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 Mike Numbers
> Sent: Thursday, June 21, 2012 8:30 AM
> To: vantage@yahoogroups.com
> Subject: RE: [Vantage] Help with ABL Code Please.
>
>
> You're right. JobOper Partnum does not match JobHead. Thanks for the tip
> on Jose's blog on debugging ABL code.
>
> Guess I need to figure out new logic to find all jobs for a partnum.
>
> Thanks again.
>
> Mike
>
> From: vantage@yahoogroups.com<mailto:vantage%40yahoogroups.com> [mailto:
> vantage@yahoogroups.com<mailto:vantage%40yahoogroups.com>] On Behalf Of
>
> Ted Koch
> Sent: Wednesday, June 20, 2012 5:16 PM
> To: vantage@yahoogroups.com<mailto:vantage%40yahoogroups.com>
>
> Subject: Re: [Vantage] Help with ABL Code Please.
>
> I could be wrong but I think you're only going to get a part number in
> JobOper.PartNum if it is a subcontract operation, and depending how you are
> structuring your jobs I dont know if your jobhead.partnum will equal
> joboper.partnum.
>
> My guess is its not doing anything because nothing matches the criteria in
> your second for each loop. Did you create a BPM and verify that a criteria
> like this returns anything? You can also debug your ABL code. Here is an
> example from Jose's blog
>
> http://www.usdoingstuff.com/2011/06/08/writing-to-a-file-from-progress-abl4g
> l/ (thanks Jose).
>
> Hope that helps,
>
> -Ted
>
> ________________________________
> From: mike.numbers <mnumbers@...<mailto:mnumbers%40cignys.com>
> <mailto:mnumbers%40cignys.com> >
> To: vantage@yahoogroups.com<mailto:vantage%40yahoogroups.com> <mailto:
> vantage%40yahoogroups.com>
>
> Sent: Wednesday, June 20, 2012 2:20 PM
> Subject: [Vantage] Help with ABL Code Please.
>
> This is my first time with ABL code with any complexity. The code validates
> but my results are not there. I have this code attached PreProcessing
> Method Directive with Labor.Update. I know it runs because I put an
> informational action after this action and it appears. The code is supposed
> to get the part number from the Jobhead, then read all completed operations
> for this part and operation and then calculate a new estprodhr and
> estsethr.
> I save the previous values in partopr.number01 and number02.
> Epicor 9.04.507a
> Any help in showing me where I screwed up would be appreciated.
> Below is my code.
> TIA
> Mike
> -----------------------------------------------------
>
> define variable AveSet LIKE PartOpr.EstSetHours.
> define variable AveProd LIKE PartOpr.EstProdHours.
>
> for each JobHead where JobHead.JobNum = ttLaborDtl.JobNum no-lock.
> if available JobHead then do:
> /* need JobHead to get Partnum */
> for each JobOper where JobOper.PartNum = JobHead.PartNum and
> JobOper.AssemblySeq = ttLaborDtl.AssemblySeq and JobOper.OprSeq =
> ttLaborDtl.OprSeq and JobOper.OpComplete = True no-lock.
>
> /* accumulate totals for each completed job for this operation */
> ACCUMULATE JobOper.QtyCompleted (SUB-TOTAL).
> Accumulate JobOper.ActProdHours (SUB-TOTAL).
> Accumulate JobOper.ActSetupHours (SUB-TOTAL COUNT).
> end.
>
> /* calculate averages */
> AveProd = (Accum Sub-Total JobOper.ActProdHours) / (Accum Sub-Total
> JobOper.QtyCompleted).
> AveSet = (Accum Sub-Total JobOper.ActSetupHours) / (Accum Count
> JobOper.ActSetupHours).
>
> /* get PartOpr to update new values */
> find PartOpr WHERE PartOpr.PartNum = JobHead.PartNum and PartOpr.OprSeq =
> ttLaborDtl.OprSeq and PartOpr.RevisionNum = JobHead.RevisionNum.
> Assign
> /* save last value*/
> PartOpr.Number01 = PartOpr.EstProdHours
> PartOpr.Number02 = PartOpr.EstSetHours
> /* move in new values */
> PartOpr.EstProdHours = AveProd
> PartOpr.EstSetHours = AveSet.
>
> /* update values */
> UPDATE
> PartOpr.Number01
> PartOpr.Number02
> PartOpr.EstProdHours
> PartOpr.EstSetHours.
>
> end.
> end.
>
> ------------------------------------
>
> Useful links for the Yahoo!Groups Vantage Board are: ( Note: You must have
> already linked your email address to a yahoo id to enable access. )
> (1) To access the Files Section of our Yahoo!Group for Report Builder and
> Crystal Reports and other 'goodies', please goto:
> http://groups.yahoo.com/group/vantage/files/.<
> http://groups.yahoo.com/group/vantage/files/>
> <http://groups.yahoo.com/group/vantage/files/>
> (2) To search through old msg's goto:
> http://groups.yahoo.com/group/vantage/messages
> (3) To view links to Vendors that provide Vantage services goto:
> http://groups.yahoo.com/group/vantage/linksYahoo! Groups Links
>
> [Non-text portions of this message have been removed]
>
> [Non-text portions of this message have been removed]
>
> [Non-text portions of this message have been removed]
>

>


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



------------------------------------

Useful links for the Yahoo!Groups Vantage Board are: ( Note:Â You must have already linked your email address to a yahoo id to enable access. )
(1) To access the Files Section of our Yahoo!Group for Report Builder and Crystal Reports and other 'goodies', please goto: http://groups.yahoo.com/group/vantage/files/.%c2%a0
(2) To search through old msg's goto: http://groups.yahoo.com/group/vantage/messages
(3) To view links to Vendors that provide Vantage services goto: http://groups.yahoo.com/group/vantage/linksYahoo! Groups Links



[Non-text portions of this message have been removed]
Just curious Mike: What business problem are you trying to solve? (What is the end purpose?)
Â
IÂ think others have made clear it is your partnum join creating the problem (and given you direction for make direct jobs, multi-asy level jobs & impact if you are using both SubContract OPs AND unique subcontract partnums).
Â
The only other thing to consider is if you use multi-part jobs (combine multiple jobs for parts that share near identical MoM into a single multi-part batch job). You'd need to tie in either JobProd or JobPart to get at partnums in that case. (Not near a data dictionary to be more specific).
Â
Really curious about what you are trying to accomplish.
Â
Rob Brown


________________________________
From: Rob Bucek <rbucek@...>
To: "vantage@yahoogroups.com" <vantage@yahoogroups.com>
Sent: Thursday, June 21, 2012 9:36 AM
Subject: RE: [Vantage] Help with ABL Code Please.


Â
Typically jobhead.partnum would contain the 'end item', jobasmbl.partnum would be each make direct assembly.

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

From: mailto:vantage%40yahoogroups.com [mailto:mailto:vantage%40yahoogroups.com] On Behalf Of Mike Numbers
Sent: Thursday, June 21, 2012 8:30 AM
To: mailto:vantage%40yahoogroups.com
Subject: RE: [Vantage] Help with ABL Code Please.

You're right. JobOper Partnum does not match JobHead. Thanks for the tip
on Jose's blog on debugging ABL code.

Guess I need to figure out new logic to find all jobs for a partnum.

Thanks again.

Mike

From: mailto:vantage%40yahoogroups.com<mailto:vantage%40yahoogroups.com> [mailto:mailto:vantage%40yahoogroups.com<mailto:vantage%40yahoogroups.com>] On Behalf Of
Ted Koch
Sent: Wednesday, June 20, 2012 5:16 PM
To: mailto:vantage%40yahoogroups.com<mailto:vantage%40yahoogroups.com>
Subject: Re: [Vantage] Help with ABL Code Please.

I could be wrong but I think you're only going to get a part number in
JobOper.PartNum if it is a subcontract operation, and depending how you are
structuring your jobs I dont know if your jobhead.partnum will equal
joboper.partnum.

My guess is its not doing anything because nothing matches the criteria in
your second for each loop. Did you create a BPM and verify that a criteria
like this returns anything? You can also debug your ABL code. Here is an
example from Jose's blog
http://www.usdoingstuff.com/2011/06/08/writing-to-a-file-from-progress-abl4g
l/ (thanks Jose).

Hope that helps,

-Ted

________________________________
From: mike.numbers <mailto:mnumbers%40cignys.com<mailto:mnumbers%40cignys.com> <mailto:mnumbers%40cignys.com> >
To: mailto:vantage%40yahoogroups.com<mailto:vantage%40yahoogroups.com> <mailto:vantage%40yahoogroups.com>
Sent: Wednesday, June 20, 2012 2:20 PM
Subject: [Vantage] Help with ABL Code Please.

This is my first time with ABL code with any complexity. The code validates
but my results are not there. I have this code attached PreProcessing
Method Directive with Labor.Update. I know it runs because I put an
informational action after this action and it appears. The code is supposed
to get the part number from the Jobhead, then read all completed operations
for this part and operation and then calculate a new estprodhr and estsethr.
I save the previous values in partopr.number01 and number02.
Epicor 9.04.507a
Any help in showing me where I screwed up would be appreciated.
Below is my code.
TIA
Mike
-----------------------------------------------------

define variable AveSet LIKE PartOpr.EstSetHours.
define variable AveProd LIKE PartOpr.EstProdHours.

for each JobHead where JobHead.JobNum = ttLaborDtl.JobNum no-lock.
if available JobHead then do:
/* need JobHead to get Partnum */
for each JobOper where JobOper.PartNum = JobHead.PartNum and
JobOper.AssemblySeq = ttLaborDtl.AssemblySeq and JobOper.OprSeq =
ttLaborDtl.OprSeq and JobOper.OpComplete = True no-lock.

/* accumulate totals for each completed job for this operation */
ACCUMULATE JobOper.QtyCompleted (SUB-TOTAL).
Accumulate JobOper.ActProdHours (SUB-TOTAL).
Accumulate JobOper.ActSetupHours (SUB-TOTAL COUNT).
end.

/* calculate averages */
AveProd = (Accum Sub-Total JobOper.ActProdHours) / (Accum Sub-Total
JobOper.QtyCompleted).
AveSet = (Accum Sub-Total JobOper.ActSetupHours) / (Accum Count
JobOper.ActSetupHours).

/* get PartOpr to update new values */
find PartOpr WHERE PartOpr.PartNum = JobHead.PartNum and PartOpr.OprSeq =
ttLaborDtl.OprSeq and PartOpr.RevisionNum = JobHead.RevisionNum.
Assign
/* save last value*/
PartOpr.Number01 = PartOpr.EstProdHours
PartOpr.Number02 = PartOpr.EstSetHours
/* move in new values */
PartOpr.EstProdHours = AveProd
PartOpr.EstSetHours = AveSet.

/* update values */
UPDATE
PartOpr.Number01
PartOpr.Number02
PartOpr.EstProdHours
PartOpr.EstSetHours.

end.
end.

------------------------------------

Useful links for the Yahoo!Groups Vantage Board are: ( Note: You must have
already linked your email address to a yahoo id to enable access. )
(1) To access the Files Section of our Yahoo!Group for Report Builder and
Crystal Reports and other 'goodies', please goto:
http://groups.yahoo.com/group/vantage/files/<http://groups.yahoo.com/group/vantage/files/>
<http://groups.yahoo.com/group/vantage/files/>
(2) To search through old msg's goto:
http://groups.yahoo.com/group/vantage/messages
(3) To view links to Vendors that provide Vantage services goto:
http://groups.yahoo.com/group/vantage/linksYahoo! Groups Links

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

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

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




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



What I have been asked to do is automatically update the estimated setup hours and estimated production hours for part operations as new jobs are completed.



Mike



From: vantage@yahoogroups.com [mailto:vantage@yahoogroups.com] On Behalf Of Robert Brown
Sent: Thursday, June 21, 2012 5:58 PM
To: vantage@yahoogroups.com
Subject: Re: [Vantage] Help with ABL Code Please.





Just curious Mike: What business problem are you trying to solve? (What is the end purpose?)

I think others have made clear it is your partnum join creating the problem (and given you direction for make direct jobs, multi-asy level jobs & impact if you are using both SubContract OPs AND unique subcontract partnums).

The only other thing to consider is if you use multi-part jobs (combine multiple jobs for parts that share near identical MoM into a single multi-part batch job). You'd need to tie in either JobProd or JobPart to get at partnums in that case. (Not near a data dictionary to be more specific).

Really curious about what you are trying to accomplish.

Rob Brown

________________________________
From: Rob Bucek <rbucek@... <mailto:rbucek%40dsmfg.com> >
To: "vantage@yahoogroups.com <mailto:vantage%40yahoogroups.com> " <vantage@yahoogroups.com <mailto:vantage%40yahoogroups.com> >
Sent: Thursday, June 21, 2012 9:36 AM
Subject: RE: [Vantage] Help with ABL Code Please.


Typically jobhead.partnum would contain the 'end item', jobasmbl.partnum would be each make direct assembly.

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

From: mailto:vantage%40yahoogroups.com [mailto:mailto:vantage%40yahoogroups.com] On Behalf Of Mike Numbers
Sent: Thursday, June 21, 2012 8:30 AM
To: mailto:vantage%40yahoogroups.com
Subject: RE: [Vantage] Help with ABL Code Please.

You're right. JobOper Partnum does not match JobHead. Thanks for the tip
on Jose's blog on debugging ABL code.

Guess I need to figure out new logic to find all jobs for a partnum.

Thanks again.

Mike

From: mailto:vantage%40yahoogroups.com <mailto:vantage%40yahoogroups.com%3cmailto:vantage%40yahoogroups.com> <mailto:vantage%40yahoogroups.com> [mailto:mailto:vantage%40yahoogroups.com<mailto:vantage%40yahoogroups.com>] On Behalf Of
Ted Koch
Sent: Wednesday, June 20, 2012 5:16 PM
To: mailto:vantage%40yahoogroups.com <mailto:vantage%40yahoogroups.com%3cmailto:vantage%40yahoogroups.com> <mailto:vantage%40yahoogroups.com>
Subject: Re: [Vantage] Help with ABL Code Please.

I could be wrong but I think you're only going to get a part number in
JobOper.PartNum if it is a subcontract operation, and depending how you are
structuring your jobs I dont know if your jobhead.partnum will equal
joboper.partnum.

My guess is its not doing anything because nothing matches the criteria in
your second for each loop. Did you create a BPM and verify that a criteria
like this returns anything? You can also debug your ABL code. Here is an
example from Jose's blog
http://www.usdoingstuff.com/2011/06/08/writing-to-a-file-from-progress-abl4g
l/ (thanks Jose).

Hope that helps,

-Ted

________________________________
From: mike.numbers <mailto:mnumbers%40cignys.com <mailto:mnumbers%40cignys.com%3cmailto:mnumbers%40cignys.com> <mailto:mnumbers%40cignys.com> <mailto:mnumbers%40cignys.com> >
To: mailto:vantage%40yahoogroups.com <mailto:vantage%40yahoogroups.com%3cmailto:vantage%40yahoogroups.com> <mailto:vantage%40yahoogroups.com> <mailto:vantage%40yahoogroups.com>
Sent: Wednesday, June 20, 2012 2:20 PM
Subject: [Vantage] Help with ABL Code Please.

This is my first time with ABL code with any complexity. The code validates
but my results are not there. I have this code attached PreProcessing
Method Directive with Labor.Update. I know it runs because I put an
informational action after this action and it appears. The code is supposed
to get the part number from the Jobhead, then read all completed operations
for this part and operation and then calculate a new estprodhr and estsethr.
I save the previous values in partopr.number01 and number02.
Epicor 9.04.507a
Any help in showing me where I screwed up would be appreciated.
Below is my code.
TIA
Mike
-----------------------------------------------------

define variable AveSet LIKE PartOpr.EstSetHours.
define variable AveProd LIKE PartOpr.EstProdHours.

for each JobHead where JobHead.JobNum = ttLaborDtl.JobNum no-lock.
if available JobHead then do:
/* need JobHead to get Partnum */
for each JobOper where JobOper.PartNum = JobHead.PartNum and
JobOper.AssemblySeq = ttLaborDtl.AssemblySeq and JobOper.OprSeq =
ttLaborDtl.OprSeq and JobOper.OpComplete = True no-lock.

/* accumulate totals for each completed job for this operation */
ACCUMULATE JobOper.QtyCompleted (SUB-TOTAL).
Accumulate JobOper.ActProdHours (SUB-TOTAL).
Accumulate JobOper.ActSetupHours (SUB-TOTAL COUNT).
end.

/* calculate averages */
AveProd = (Accum Sub-Total JobOper.ActProdHours) / (Accum Sub-Total
JobOper.QtyCompleted).
AveSet = (Accum Sub-Total JobOper.ActSetupHours) / (Accum Count
JobOper.ActSetupHours).

/* get PartOpr to update new values */
find PartOpr WHERE PartOpr.PartNum = JobHead.PartNum and PartOpr.OprSeq =
ttLaborDtl.OprSeq and PartOpr.RevisionNum = JobHead.RevisionNum.
Assign
/* save last value*/
PartOpr.Number01 = PartOpr.EstProdHours
PartOpr.Number02 = PartOpr.EstSetHours
/* move in new values */
PartOpr.EstProdHours = AveProd
PartOpr.EstSetHours = AveSet.

/* update values */
UPDATE
PartOpr.Number01
PartOpr.Number02
PartOpr.EstProdHours
PartOpr.EstSetHours.

end.
end.

------------------------------------

Useful links for the Yahoo!Groups Vantage Board are: ( Note: You must have
already linked your email address to a yahoo id to enable access. )
(1) To access the Files Section of our Yahoo!Group for Report Builder and
Crystal Reports and other 'goodies', please goto:
http://groups.yahoo.com/group/vantage/files/<http://groups.yahoo.com/group/vantage/files/>
<http://groups.yahoo.com/group/vantage/files/>
(2) To search through old msg's goto:
http://groups.yahoo.com/group/vantage/messages
(3) To view links to Vendors that provide Vantage services goto:
http://groups.yahoo.com/group/vantage/linksYahoo! Groups Links

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

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

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

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





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