Purpose With Sort you can sort the rows of a GuiXT table variable. It is also possible to re-sort a sequentially numbered number of individual variables.
Examples Sort  V[mytab] orderby="kunnr,gjahr"
Ascending sorting of the rows in V[mytab] according to the columns "kunnr" and "gjahr" 

Sort "mx_matnr_"
The values of the variables V[mx_matnr_1], V[mx_mantr_2], V[mx_matnr_3] ,... are put into ascending order. 

Sort "mx_tab_%row_%col" -descending rowcount=84 colcount=12 orderby=3
The rows of a matrix of variables V[mx_tab_1_1],  V[mx_tab_1_2], V[mx_tab_1_3], ..... until V[mx_tab_84_12] are put into descending order, depending on the value of column number 3.  

Sort "pt_%col_%row" columns="pronr,begdate,duration,budget,status" orderby="budget" rowcount=31
Ascending ordering of a matrix of variables with the specified column names: V[pt_pronr_1], V[pt_begdate_1], V[pt_duration_1 ... . to V[pt_status_31].  

Sort table="prtab" orderby="budget" -descending
Descending ordering of table "prtab" (see
Table command) by the column "budget". 
Format Sort V[mytab]
Sorts the rows of the table variable V[mytab]

Sort "varname"
Sorts a one-dimensional array of variables V[varname1], V[varname2],..

Sort "varname_%row_%col"
Sorts all rows of a 2-dimensional array (matrix) of variables, where "%row" is replaced by the row index and  "%col" by the column index.

Sort table="prtab"
Sorts the variables belonging to a self-defined table control

Additional options when sorting a table variable
-descending Descending ordering
-reverse Within the same key values, the sequence is reversed.
orderby= Names of the columns to be sorted by, separated by commas. If not specified: all columns from left to right.
-ignorecase Sorting independent of upper/lower case
-linguistic Language-specific sorting, e.g. umlauts "", "", "" or "" for the corresponding letters, "" like "ss
locale= Optional specification of a "locale" that determines the sort order, e.g. locale="en-GB" (language and region)
Additional options for sorting individual variables
-descending Descending ordering
rowcount= Number of rows to be sorted. If not specified, GuiXT determines the row count automatically, counting the existing variables.
colcount= Number of columns. If not specified, a one-dimensional array is assumed, i.e. colcount=1.
When specifying 
columns= or table= the number of columns is determined automatically .
orderby= Specifies the number of the column that determines the ordering. If not specified it is assumed to be the first column.
If you specify
columns= or table= the column name can be used instead of the column number.
columns= A list of column names, separated by commas.  The column names are used to form the names of the variables to be sorted, i.e.  %col is replaced by the corresponding column name instead of the column number.
table= Used to sort the variables belonging to a self-defined table control (see Table command). All table variables representing the cell values are sorted.
Please observe: If the table contains empty rows at the end that should not be included in the sorting, you need to specify 
Additional hints
  • The columns can contain strings, numbers or dates; the ordering is type-specific, e.g. 89  before 100 but A98 after A100.
  • The sort is stable; this means that rows with equal sort key are not changed. As a consequence, sorting by multiple columns can be implemented using one sort statement for each column, starting with the last sort column.
Components GuiXT + InputAssistant