We suggest the following conventions / standards when working in FAB:
For naming standards and conventions in ABAP, please navigate here.
We recommend different naming strategies for naming data model fields, depending on the source/target of the data field in question.
We often have two fields where the first field contains a code and the second field (used as a label, description or tool-tip, for example) contains the name / description for the code contained in the first field. To avoid variation (Name vs Description vs Desc vs Descr vs Text vs Xxxx) we recommend always using 'Name'. Therefore:
CostCenter and CostCenterName
ControllingArea and ControllingAreaName
In instances where a field is named XxxCode or YyyKey (or similar) we recommend dropping the 'Code' or 'Key' and replacing it with 'Name' for the description field, for example:
CompanyCode and CompanyName
CurrencyKey and CurrencyName
Exception: where the word 'Key' is part of the name, as opposed to simply indication that the field contains a code/key, it may remain part of the description field name:
PostingKey and PostingKeyName
It is important to remember that the data model is the 'area of exchange' through which data is effectively passed from the front-end to the back-end, and vice versa. During this process, conversion takes place between the data as it is declared in the front-end and the equivalent data as it is declared in the back-end (in ABAP).
Creating your data model field with the correct types ensures that FAB can create the fields correctly for use in both JavaScript and ABAP.
To avoid conversion issues (especially with numbers and dates) where we then have to manually handle conversions in ABAP or JavaScript, we recommend that all fields should be typed explicitly with both ABAP and Javascript types, whenever possible.
The exception to this is where the field should be declared as a text-type field in both the front- and back-end. In this instance, FAB will assume both to be text in the absence of explicit typing.
Please remember that components / elements in your project do not always have to be named explicitly - if no ID is assigned, FAB will assign one at run-time. Where you do want to name these (for readability, for example, or to be able to refer to the component in code) we recommend a flexible approach, using a simple set of rules to determine a 2- or 3-character prefix:
Using the above rules to create a prefix and combining it with a descriptive name for a field one will be able to understand, at a glance, what type of component is represented by an ID. For example:
We recommend the following with regards to icon usage:
Where? | Icon Name | Icon | Suggested tooltip |
---|---|---|---|
Button to exit from an App | system-exit sap-icon://system-exit | Exit | |
Button to return to Fiori (or FAB) Launchpad | home sap-icon://home | Home |