Texttypes: how they look and how to use them
This blog post is intended to introduce all relevant text types in Business ByDesign and show what their limitations are, how to deal with them and how they are represented in the interface. As example the character length and automatically cut off. The blog post is aimed at everyone who is learning ByD development, or at those who already know how and who want to quickly look up or copy the relevant information.
The first part of the blog shows the text types and usage in the development of Custom BO’s, the second one is about extensions of standard objects. The last part is about miscellaneous.
For custom BO’s the common text types in SAP Business ByDesign are listed below with their character restrictions, so you don’t have to switch between your source code and the Repository Explorer to review them.
The names are the technical ones, so feel free to copy them right in your source code.
- SHORT_Name 10 Chars
- SHORT_Description 40 Chars
- SHORT_Note 40 Chars
- MEDIUM_Name 40 Chars
- MEDIUM_Description 80 Chars
- MEDIUM_Note 80 Chars
- LONG_Name 80 Chars
- LONG_Description 255 Chars
- LONG_Note 255 Chars
- LANGUAGEINDEPENDENT_SHORT_Name 10 Chars
- LANGUAGEINDEPENDENT_SHORT_Description 40 Chars
- LANGUAGEINDEPENDENT_SHORT_Note 40 Chars
- LANGUAGEINDEPENDENT_MEDIUM_Name 40 Chars
- LANGUAGEINDEPENDENT_MEDIUM_Description 80 Chars
- LANGUAGEINDEPENDENT_MEDIUM_Note 80 Chars
- LANGUAGEINDEPENDENT_LONG_Name 80 Chars
- LANGUAGEINDEPENDENT_LONG_Description 255 Chars
- LANGUAGEINDEPENDENT_LONG_Note 255 Chars
- [DependentObject(TextCollection)] node TextCollectionSingleText; unlimited (“TextCollectionSingleText” is a custom name, use whatever you like)
If you don’t want to test how it looks in the user interface for every element, no problem, the following screenshot shows you how the previous elements are displayed. The screenshot shows the default look as input field. This can be modified. The language dropdowns for the language dependent values are optional.
Feel free to use elements of the screenshots for mockups or discuss the appropriate UI style with your customer.
As mentioned above, each element has a specific character restrictions, the framework will automatically check the length for these data types in the user interface for SAP Business ByDesign. But there are also some special cases, in which you have to check it on your own. I suspect this is only necessary if the data are not entered via the user interface. Please refer to the Blogpost.
The unlimited text type is a little different. You can display it with an embedded component (EC). Therefore, you cannot use it in every context, as example you can’t use it in an object value selector (OVS). It‘s also described in the SAP Cloud Applications Studio documentation „22.214.171.124 Dependent Object (Business Object) “
The EC’s to use the DependentObject(TextCollection) with different text collection are in /SAP_BYD_APPLICATION_UI/Reuse/Notes/* . You can add them to your custom screens.
For BO Extensions the common text types in SAP Business ByDesign are listed below with their character restrictions. There are less then for custom BO’s, but they will fit the common requirements. The names are the technical ones, so feel free to copy them right in your source code.
- ShortText 40 Chars
- MediumText 80 Chars
- LongText 120 Chars
If you use text fields in the UI-Extensions you have to ensure that you do not click on “DisplayOnly” (Number 2 in the following screenshot) for text types in the extensibility explorer, this can cause malfunctions. if you don’t want the user to change the text, you have to select the “ReadOnly” (4) option. (It’s similar in the Adaption Mode for Key users. But in this case the system will automatically delete the “DisplayOnly” flag when you save, instead of preventing to set it…)
Here you can see how the extension fields in standard views are displayed in the user interface (it’s not possible to modify the look).
Usually you can use a implicitly typed variable as “var” to store text during the runtime in your ABSL script. But sometimes you need an explicit type, then you may use LANGUAGEINDEPENDENT_Text. As example for a text collection:
var exampleTextCollection :collectionof LANGUAGEINDEPENDENT_Text;
The above mentioned datatypes are in the namespace: AP.Common.GDT you can read the details of the data types in the Repository Explorer (with the exception of the three text data types for xbo’s).
There are a lot of additional text types in other namespaces like:
but I’m not sure what these should be used for. Whatever, the data types mentioned at the beginning are those that are needed in everyday work and are recommended by SAP (see linked blog post).
If you use other types of text, from other namespaces, in development, please write a comment and start a conversation about their purpose.