Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Arrays/internal tables, sorting #176

Open
6 tasks
larshp opened this issue Aug 19, 2021 · 1 comment
Open
6 tasks

Arrays/internal tables, sorting #176

larshp opened this issue Aug 19, 2021 · 1 comment

Comments

@larshp
Copy link
Collaborator

larshp commented Aug 19, 2021

In ABAP, everything is stored in a relational database.

JSON files can be edited manually in any editor,

The developer can edit the JSON files changing any sorting of arrays, which is okay, but serialization of objects should follow a specific sorting(not depending on the default database sorting semantics)

Suggestion:
Require that all internal tables defined in AAF are sorted tables with a defined key (no multiple keys, no HASHED tables, no DEFAULT KEY)

I don't think its possible to have array sorting defined in json schema?

  • Update documentation
  • Add new rule to abaplint, so the developers can be reminded automatically
  • Change the schema generator, so the sorting is added in the description of the field, which allows the developer to determine what is expected
  • Rework CHKO
  • Rework CHKV
  • Rework ENHS
@schneidermic0
Copy link
Contributor

I think in general, it make sense to specify tables as sorted to define the order during serialisation to avoid unnecessary diffs.

However, I think there are also use cases in which unsorted tables is fine, because you have no criteria to sort the entries automatically by the table key.

Examples

Example 1
For table indexes we had the situation that the order of fields in an index is relvant how the index is created on the database. If this shall be sorted (by the type) we would have to introduce an index field in the file format, which I think would not be necessary, because it introduces redundant data). Here the order would be just sufficient.

See #354 (comment)

Example 2
Similar situation might be here: #380 (comment)

Example 3
Another Example: Let's assume we have a file format for SAPsctipt documents. An entry for the document might be the format and the text of a document line. Do we want to introduce an index here or just assume that the order of the entries specifies the order of the content.

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

No branches or pull requests

2 participants