In 2020, Jerry will make a new attempt. He will answer the questions raised by some friends on the official account, Knowledge Planet or wechat circle, which may help more friends. See my previous article: A new attempt at SAP trivia in 2020

Questions from netizens:

Jerry’s answer:

The above screenshot is the information seen after opening any Context Node after entering the transaction code BSP_WD_CPMWB in CRM system:

What does STRUCT mean?

In Jerry’s previous article Jerry’s collection of 42 original articles on WebClient UI mentioned this diagram:

In the MVC design of the UI Layer CRM BSP Component, the Model, i.e. Context node, is bound to the Model of the Business Object Layer, so under the Context Node Attributes folder, A field starting with STRUCT means that the field is bound to a field in the BOL model node, and there is a one-to-one correspondence between the two, as shown by the arrow in the figure below. In the figure below, the blue field LOCKED, with no STRUCT prefix in front of it, indicates that the field is not from the BOL model node, but is created directly by the developer. This field is usually used to store temporary state in the application logic, or to represent a flag bit of the current application. There is no underlying storage. This field is also called a transient field or calculated field in many SAP products.

What does GET, GET_M, GET_I, GET_V, GET_P, GET_A mean when you expand a field?

To answer this question, start with the way CRM WebClient UI pages are rendered.

View source code, such as the one shown above, uses tags that are not native HTML supported and cannot be recognized and parsed by the browser, so there needs to be an intermediate layer, or converter, to convert these SAP-wrapped tags into native HTML supported by the browser.

Depending on the location of the converter, there are two methods of server-side rendering and browser-side rendering. SAP CRM WebClient UI is based on SAP BSP technology — Business Server Page. SAP UI5, on the other hand, is a typical browser-side rendering. The tags we write in its XML view cannot be directly used by the browser, requiring the renderer corresponding to each tag to generate the corresponding native HTML tags with JavaScript code on the browser side.

Back to the CRM WebClient UI, for the STRUCT fields in Attributes, we render the final page, some are general input fields, some are hyperlinks, some are drop-down boxes, and some are not editable. How does the CONVERTER developed by SAP know how to render each field?

The trick is in these GET methods. Here is a small design mode ideas, that is, SAP CRM WebClient UI framework code, responsible for server rendering 80% of the workload, that is, the whole page frame out, including a page how many fields, the relative position between fields, etc.. The remaining 20% of the work, such as the type, appearance, and other attributes of each field, is information that the framework cannot and should not know, and that the application should provide interfaces (also known as callbacks) to implement these attributes, and then the framework should call those interfaces. We can think of this Pattern as a kind of Design Pattern — Template Design Pattern.

Look at specific examples.

Double-click to enter the GET_P method of the CONFIG field. P stands for Property. When the UI framework renders CONFIG, it calls GET_P_CONFIG and asks the application: What type do you want to render CONFIG (fieldType, line 4 below)?

The application replies with the field_type_checkbox frame on line 5: I want to render the CONFIG field as a checkbox, please.

Once the UI framework has this information, it can do the corresponding rendering.

To explore the details of how the UI renders the field type, break the point in the GET_P method, and then open a page and step through the log:

GET_I: If the application logic needs to dynamically determine whether the field is editable based on some condition, write the logic in this interface.

Pure GET_P method: There’s a lot going on here, especially the CONVERT_TO_STRING method, which renders the corresponding fields in the underlying database tables into a final user-friendly string based on the field types in the BOL model. For example, if a timestamp without any time zone is stored in the underlying database table, this method will automatically convert the time zone to the local time of that time zone based on the time zone set by the user.

GET_V: If you want to implement a custom F4 Value Help, implement it here.

GET_A: Whether a field is enabled or not depends on whether a Business Switch is enabled or not. View and operate Business Switch and Function in the sequence of transaction codes at the beginning of SFW.

Fields starting with EXT represent enhanced fields created through the CRM enhancement Tool Application Extension Tool(AET).

I hope this article answers this friend’s question. Thank you for reading.

reading

For more of Jerry’s original articles, please follow the public account “Wang Zixi “: