Skip to content

Instantly share code, notes, and snippets.

@vinodronold
Last active March 13, 2020 03:59
Show Gist options
  • Save vinodronold/c5f69dafc0d9befe6652e5de5a8af316 to your computer and use it in GitHub Desktop.
Save vinodronold/c5f69dafc0d9befe6652e5de5a8af316 to your computer and use it in GitHub Desktop.
Computing the total hours worked per earnings code
Local PACKAGE:NumberHashtable &oHrsByErnCd = Create PACKAGE:NumberHashtable();
Local Rowset &rsTSIntfc = CreateRowset(Record.Z_TSINFC_VW);
REM Get all the timesheets for the week
&rsTSIntfc.Fill(" WHERE EARNS_END_DT = %DateIn(:1) AND EMPLID = :2 ", &Timesheet.WeekEndDate, &Timesheet.EmplID);
For &nCnt = 1 To &rsTSIntfc.RowCount
&recTSIntfc = &rsTSIntfc(&nCnt).Z_TSINFC_VW;
REM Add the Hours to the Hashtable with ERNCD as the Key
&oHrsByErnCd.Add(&recTSIntfc.ERNCD.value, &recTSIntfc.TOTAL_HRS.value);
End-For;
REM We can use &oHrsByErnCd for further processing
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment