Skip to content

Feature Request: Auto-reorder CDS annotation positions #509

Description

@eaglebeagle999

Description:
When inserting a new field between existing positions in CDS @UI.lineItem or @UI.identification annotations, the positions are not automatically adjusted to multiples of 10.

Example – Original (after manual insert):

@UI.lineItem: [{ position: 10 }]
Product;

@UI.lineItem: [{ position: 15 }]   -- manually inserted
ProductGroup;

@UI.lineItem: [{ position: 30 }]
ValuationArea;

@UI.lineItem: [{ position: 20 }]
Plant;

Expected result after cleanup:

@UI.lineItem: [{ position: 10 }]
Product;

@UI.lineItem: [{ position: 20 }]   -- rounded up to next multiple of 10
ProductGroup;

@UI.lineItem: [{ position: 40 }]   -- adjusted accordingly
ValuationArea;

@UI.lineItem: [{ position: 30 }]   -- adjusted accordingly
Plant;

Rule behavior:

Detects @UI.lineItem and @UI.identification position sequences that are not multiples of 10
Rounds up the inserted position to the next multiple of 10
Adjusts all following positions accordingly
Applies to all @ui annotations that use a position property

Why is this useful?
Manually inserting fields between existing positions leads to irregular numbering (10, 15, 20...). This clutters the code and forces developers to manually renumber all subsequent positions. Auto-reordering to multiples of 10 follows the common SAP convention and keeps annotations clean and maintainable`

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions