mhughes0107
New Member
Hello, I'm fairly new to QAD/MFGPro.
I'm trying to use the code below to take "run time" transaction data and combine all the run times that share four things in common (employee number, work order, date, and project code). My research has brought me to the conclusion that I should be using the "Local Variables" tab within Browse Maintenance to enter the code and displace the fields using calculated fields.
However, when I enter the code into Local Variables, I get the attached error code when I try to save the browse.
Can anyone help me figure out what's going wrong?
Also, can someone help me with pulling the information from the temp table into a calculated field?
I'm trying to use the code below to take "run time" transaction data and combine all the run times that share four things in common (employee number, work order, date, and project code). My research has brought me to the conclusion that I should be using the "Local Variables" tab within Browse Maintenance to enter the code and displace the fields using calculated fields.
However, when I enter the code into Local Variables, I get the attached error code when I try to save the browse.
Can anyone help me figure out what's going wrong?
Also, can someone help me with pulling the information from the temp table into a calculated field?
DEFINE TEMP-TABLE tt_aggregated NO-UNDO
FIELD op_emp AS INTEGER
FIELD op_wo_nbr AS INTEGER
FIELD op_date AS DATE
FIELD op_project AS CHAR(30)
FIELD combined_runtime AS DECIMAL.
DEFINE VARIABLE rec AS RECORD
op_emp INTEGER
op_wo_nbr INTEGER
op_date DATE
op_project CHAR(30)
op_act_run DECIMAL
NO-UNDO.
FOR EACH op_hist NO-LOCK BY op_hist.op_emp
BY op_hist.op_wo_nbr
BY op_hist.op_date
BY op_hist.op_project:
FIND FIRST tt_aggregated WHERE tt_aggregated.op_emp = op_hist.op_emp
AND tt_aggregated.op_wo_nbr = op_hist.op_wo_nbr
AND tt_aggregated.op_date = op_hist.op_date
AND tt_aggregated.op_project = op_hist.op_project
NO-LOCK NO-ERROR.
IF AVAILABLE tt_aggregated THEN
DO:
tt_aggregated.combined_runtime = tt_aggregated.combined_runtime + op_hist.op_act_run.
END.
ELSE
DO:
CREATE tt_aggregated.
ASSIGN
tt_aggregated.op_emp = op_hist.op_emp
tt_aggregated.op_wo_nbr = op_hist.op_wo_nbr
tt_aggregated.op_date = op_hist.op_date
tt_aggregated.op_project = op_hist.op_project
tt_aggregated.combined_runtime = op_hist.op_act_run.
END.
END.