SAP Knowledge Base Article - Public

3673809 - Sorting Behavior When Using Number Range with Prefix

Symptom

When IDs are defined using a Number Range with a Prefix (for example, X-), the sorting order is determined differently than for purely numeric values.

Environment

  • SAP Sales Cloud Version 2
  • SAP Sales and Service Cloud Version 2

Reproducing the Issue

  1. Open the Navigation menu.
  2. Select Sales Quote view.
  3. Sort the ID column by Ascending or Descending.

Cause

When a Number Range includes a Prefix (for example, X-), the system treats the entire ID as a string rather than a number. Therefore, sorting follows lexicographical (alphabetical) order instead of numeric order.

Resolution

Sorting for IDs with prefixes is performed based on the complete string value. As a result, records are sorted according to character order rather than numeric value — for example, X-100 appears before X-9 because "1" comes before "9" in lexicographical order.

This same behavior can also be observed in other entities such as Sales Orders, Cases, and similar business objects.

If you believe the sorting logic could be enhanced, we recommend submitting a request in the Influence Portal so it can be considered for future product improvements.

Keywords

number range, prefix, sorting, lexicographical order, string sorting, numeric sorting, ID order, sort by, alphanumeric sorting, sales order, case, sales order , KBA , CEC-CRM-CQP , Sales Quote for SAP Sales/Service Cloud , CEC-CRM-CAS , Case Management for SAP Sales/Service Cloud , CEC-CRM-SO , Sales Order for SAP Sales/Service Cloud , How To

Product

SAP Sales Cloud and SAP Service Cloud Version 2 1.0