When you specify a sort order for a source definition in a mapping, the Designer generates an Order By statement beginning with the first column in the definition. The Designer generates the Order By statement using the following guidelines:
If you specify a number of ports greater than the number of ports in the source definition, the ABAP program generates an Order By statement with all ports in the source definition.
SAP requires all columns in the Order By statement to be part of the select statement. If you include a column in the Order By selection, but you do not project it into the Application Source Qualifier, the ABAP program adds that column to the select statement. However, the ABAP program does not extract the data from the column you excluded from the Application Source Qualifier.
The Order By statement differs for exec SQL, open SQL, and ABAP join syntax. The following samples are based on the same mapping that joins KONH and KONP in one Application Source Qualifier. Each source definition is configured to order by three ports.