Applying sorting and subtotaling to table fields
In this recipe, we will see how we can sort a given table within the Smart Form and calculate totals based on a particular field as the sort criterion. In this recipe, we will use an example of employees and their allowances and amounts.
For this recipe, we define a structure in the database ZST9_EMPLOYEES comprising three fields PERNR, ALLOWANCE, and AMOUNT. We define a table type also based on this structure, as shown in the following screenshot:
A table EMPLOYEE_TABLE (based on the defined dictionary table type) is included in the TABLES tab of the Smart Form interface, and a corresponding ...