Overview
Tabs are a good way to structure content without having to open a new dialog. This allows the user to dynamically show or hide parts of the current view.
Normally, the content of an unselected tab is simply hidden. A special feature of the S10 Framework, however, is that the data to be displayed on a particular tab is not requested until it is also selected by the user.
This avoids long loading times and only data that is actually needed is transferred.
Implementation
First, the area is defined where the user can select different tabs. Each tab is assigned a unique ID, the tab selected during the first display is assigned the class "tabactive", all other tabs are assigned the class "tab": HTML
Thus, the name of an area belonging to a particular tab is composed as follows: "Rider ID".area
The area that belongs to the active tab before the user selects another one has the class "tabpageactive", all others "tabpage".
Actions when changing the rider
When the user changes the tab, the method "on_init_[screenid]_[tabid]" is called, e.g. "on_init_main_tabsecond".
You can provide the data to be displayed on the new tab either in this method or through build methods. If you get all tab data by build methods, the method "tab_[screenid]_[tabid]" can be omitted. The build methods have the advantage that you can easily move data from one tab to another in development and still have everything running correctly.
Set active rider
When you call a new screen in an ABAP method with s10nextscreen(), you can pass the name of a tab as a parameter, which is then set and displayed as the active tab.