Skip to content

Conversation

@1110101
Copy link

@1110101 1110101 commented Nov 5, 2025

Hi Colleagues,

we would like to improve the llm guidelines regarding formatting data in XML views.

Thank you for your contribution! 🙌

To get it merged faster, kindly review the checklist below:

Pull Request Checklist

@cla-assistant
Copy link

cla-assistant bot commented Nov 5, 2025

CLA assistant check
All committers have signed the CLA.

@matz3 matz3 requested a review from KlattG November 6, 2025 15:21
Copy link
Member

@matz3 matz3 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, requesting UA review by @KlattG

@akudev
Copy link
Member

akudev commented Nov 7, 2025

Also looks good to me.

The only concern is what the size of the guidelines will be over time. I know of another incoming guideline extension in the Form area. Every added piece improving one thing will make all other things a tiny bit worse because they lose a bit of focus. But that's not a problem at this point yet.

@1110101
Copy link
Author

1110101 commented Nov 7, 2025

I agree that this will be an issue in the future. I noticed that on my local agent rules. I would also agree that this is not a problem yet.

Copy link

@KlattG KlattG left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I suggest rephrasing the new content for clarity and conciseness.

@1110101
Copy link
Author

1110101 commented Nov 11, 2025

Applied changes suggested by @KlattG and fixed the commit message

@1110101 1110101 requested a review from KlattG November 11, 2025 12:26
Co-authored-by: Günter Klatt <57760635+KlattG@users.noreply.github.com>
Copy link

@KlattG KlattG left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

- **ALWAYS** use data binding in views to connect UI controls to data or i18n models.
- When binding data from OData services, **NEVER** use custom formatters for standard data types (e.g., dates, numbers, currencies). The built-in types handle these cases automatically.
- **ALWAYS** prefer built-in data types with format options for formatting in data binding:
- To handle standard formatting needs, use **built-in data types with format options**, for example `sap.ui.model.type.Integer` or `sap.ui.model.type.Currency` with a `formatOptions` object. For OData models, use the types provided in the `sap.ui.model.odata.type` namespace, for example `sap.ui.model.odata.type.Decimal`.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The OData types can also be used w/o ODataModels. Would we not enforce the usage of the OData types? I.e. recommend sap.ui.model.odata.type.Currency and sap.ui.model.odata.type.Int64. Non-OData types should only be used if there is no matching OData type, e.g. for DateInterval.
Background: OData types work also w/o OData. And the data often enough comes from an OData-service even if a JSONModel is used (at least in the SAP context).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants