Within selection screens, tabstrips and listboxes may be displayed without the need of knowing or using the screen painter. This may be done using a few ABAP statements. In this recipe, we will see how tabstrips and listboxes may be added to selection screens. We will create a program that will contain a tabstrip containing two tabs, each containing a listbox representing country names. By default, we will have USA displayed on the first tab and Canada on the second.
For creating tabstrips and listboxes, follow the following steps:
100
as the subscreen. Within the subscreen we define a block that contains a listbox. On the subscreen, we will create a listbox for country that will, by default, show US
(USA) as the country. The subscreen will be shown in the first tab of the tabstrip that we will be defined in a later step. 101
, within which we create another parameter input displayed as a listbox having length 20
. The default value we have for this listbox is CA
, that is Canada. The user command code, COU2
, is defined for this listbox.100
and 101
defined earlier.tab1
and tab2
. Within the initialization
event, the tab1
and tab2
fields are assigned the texts, Tab1 and Tab2, using the text-001
and text-002
text symbols defined earlier.The coding creates a tabstrip having two tabs with the text Tab1 and Tab2 respectively. Each tab page is assigned a subscreen that contains a listbox having country as the input field. When the user clicks on a particular tab title, the elements in that subscreen become active and are displayed. The COUNTRY field is defined using the GBLND field of the PA0002
table. We specified US as the default value for the listbox on the first tab. The text for US, that is United States, is displayed in the first tab.
For the second tab, the country Canada is displayed by default. The user may choose the country of his coice.
18.119.131.10