Manage Sorting Orders
In this document the creation of user-defined sorting orders in different programs is described. The sorting order determines the sorting order of the fields and the search capabilities displayed on the panel.
Outcome
A user-defined sorting order will be created. One or several views will have been connected to the sorting order.
Sorting orders are stored in the CSYVIU table. Sorting orders are connected to sorting options, views and selection tables.
Using sorting orders enables you to display only the piece of information that you will need.
Before you start
A view must have been created. See Manage Views.
Follow these steps
When creating a sorting order, you can choose whether you want to start using it in a program or directly in 'Sorting Order. Open' (CRS022).
In some programs, you have the possibility of creating selection tables in 'General Selection Table. Open' (CRS023) and 'Selection Table. Select Fields' (CRS026).
-
To create a sorting order, open the 'Sorting order. Open' (CRS022/B) panel.
Another way of launching (CRS022) is to press F4 twice in the 'Sorting order' field of the program in which you are working, such as 'Delivery. Open Toolbox' (MWS410).
-
If you have started on the (CRS022/B) panel, fill out the 'Program' field and press Enter.
-
Define a sorting order in the 'Sorting order' field. Press Enter.
-
Specify values in the 'Description' and 'Name' fields on the (CRS022/E) panel.
-
In the 'Sorting Option' field on the (CRS022/E) panel, press F4 twice to open the 'Sorting Option. Open' (CRS021/B) panel.
To create a user-defined sorting order, you must create (or select) sorting options in (CRS021). In addition, select the number of filters in (CRS022) and the views in 'View. Open' (CRS020).
To create a sorting option, go to step 9.
-
On the (CRS022/E) panel, fill out the 'Number of filters' field.
The field indicates the number of key fields that will act as filters in the selected sorting option. The fields are selected starting from the first field and then field by field throughout the key definition.
Note: A value must be entered in fields that work as filters if the record should be displayed. -
In the 'View' field on the E panel, select the desired views for your sorting order by pressing F4 twice. This opens the 'View. Open' (CRS020/B) panel. Select your desired alternatives and then press Enter.
-
Pressing Enter opens the (CRS022/E) panel and your selected view will be displayed. Continue to the next view field to have several views from which to choose. You may select up to six views for your sorting order.
If you want to create a view of your own, see Manage Views.
-
To create a sorting option, click in the 'Sorting Option' field on the (CRS022/E) panel and press F4 twice to open the 'Sorting Option. Open' (CRS021/B) panel.
-
On the (CRS021/B) panel, define a sorting option in the 'Sorting option' field and then press Enter.
-
Specify values in the 'Description' and 'Name' fields on the (CRS021/E) panel.
-
In the 'Key' field, press F4 twice. On the 'Field Group. Display Permitted Fields' (CRS109/B) panel, select the fields that you want as sorting fields.
-
On the E panel, there could also be 'Descending' fields or 'Aggregation' fields, depending on which file you make sorting options for.
The 'Descending' field controls whether or not sorting of the field values should be descending.
The 'Aggregation' field indicates whether to aggregate the records in the list view. The valid alternatives are:
0 = No. Display detailed.
1 = Yes. Aggregate if the information in the selected fields matches.
Note that times and quantities are totaled during aggregation.
-
In the 'Field' column on the (CRS021/F) panel, define which database fields to use. Press F4 twice and choose among the fields on the 'Field Group. Display Permitted Fields' (CRS109/B) panel. In the 'Value' field, specify which values to test. 'Select/Omit' shows whether these values should be included excluded.
By limiting the fields and values in this way, the record will be displayed faster than it would have been without a selection.
-
Raise the status of your recently created sorting option by choosing alternative 20='Activate' on the (CRS021/B) panel. Press F5='Refresh' to display the new status.
-
On the (CRS021/B) panel, select the sorting option that you created. Press Enter and the (CRS022/E) panel will be redisplayed.
Parameters to set
Program ID/ Panel | Field | The field indicates … |
---|---|---|
(CRS022/B) | Sorting order | …the currently selected sorting order in use. Each sorting order contains a suggested column layout and sorting sequence, plus an optional setup of selections. Press F4='Browse' to browse the available sorting orders. User-defined sorting orders can be defined in addition to the standard sorting orders. |
(CRS022/B) | Program | …the program in which the sorting order is used. See the field help for valid programs. |
(CRS022/E) | Sorting option | …the ID of a unique setup used to sort a file. Sorting options can be used to create user-defined sorting orders. The sorting is controlled by selected sorting fields and by how they are related to each other. |
(CRS109/B) | Key field | …the fields that are used to create search paths for user-defined tables. These fields are also used to create the contents of user-defined files. |
(CRS021/E) | Descending | …whether sorting of the key field should be descending. |
(CRS022/E) | Number of filters |
…the number of key fields in the selected sorting option that should act as filters. The fields are selected starting from the first key field and then field by field throughout the key definition. A filter is used to make field selections. If the record should be displayed, a value must be entered in the filter. |
(CRS022/F) | View 1-6 | …the view that is in use. Views are user-defined and determine the sorting order and the column layout. |
If sorting option is used (SOUS = 2), additional parameters are shown.
-
Change filter
This defines whether the number of filters should be changeable in the very program.
-
Max number of records
The maximum number of database records (database reads) that will be performed. If the maximum number is reached, the sub field build is stopped and an error message is displayed. The field is used to ensure that the computer has the capacity to manage a large number of records. If no value is entered in this field, the number of records will be maximized to 1,000. Normally, the value is greater than 1,000 and less than 10,000. 'Records' refer to the number of items, customers, etc.
-
Single division
This controls whether the sorting order should only display records for a single division. If this field is selected, 'Division' must be selected as the first filter. Users that are working in a single division (local users) can only use sorting orders that have the 'Single division' field selected. Users that are working in all divisions (central users) can use all sorting orders regardless of the setting in the 'Single division' field.
-
Selection field 1-3
The ID of the three fields that should be used as 'From' and 'To' selection fields in the program.
-
Aggregation
Aggregation is used to accumulate several records into one record. Aggregation levels are used to indicate how records in the list will be aggregated. Key fields that are not included in the aggregation level will be aggregated. The presentation of aggregated fields is defined per view and field in the aggregation display rule. The number of aggregated records is always stored in the S0NAGG field. This field can be used to find out if a subfile record is aggregated. The virtual field &NAGG is automatically added to the field group and can be used for the view to display the number of aggregated lines.
-
Change aggregation
This controls whether aggregation should be changeable in the very program.
-
Subtotal 1-3
Subtotals are used to insert a subtotal record when the value in a specific key field is updated. Any key field in the selected sorting option can be used as a break level for the subtotal. The presentation of the subtotal record is defined per view and field in the subtotal rule.
-
Translate description
For programs supporting configurable views, the new check box 'Translate description' has been added on 'Sorting Order. Open' (CRS022/E). If the check box is selected, a sorting order description is generated automatically per language in (CRS830) the first time this is required. An automatically generated description is always based on the 'Sorting' option. The automatic generation is triggered by (CRS022/B) or (CRS022/E). It is also triggered by some configurable view programs at startup. If the check box is not selected, a description must be updated manually in (CRS022) or per language in (CRS830).
In some programs, you have the possibility to create selection tables in 'General Selection Table. Open' (CRS023) and 'Selection Table. Select Fields' (CRS026).