Hello Experts,
What I want to achieve is - create a tabstrip with 2 tabs in a std selection screen. When tab2 is displayed, I should have 2 buttons in the application toolbar of the std selection screen. When tab1 is clicked, these two buttons should disappear.
What is actually happening now is - tab1 is displayed as soon as I execute the program (at this point, those buttons do not appear). When I click on tab2, the two buttons appear in the application toolbar. It is good till here. But when I go back to tab1, these two buttons do NOT disappear. The following is the code I wrote to achieve my objective. Could you please help me find where I am going wrong?
TABLES: SSCRFIELDS.
DATA: GW_SEL_BUTTON TYPE SMP_DYNTXT
SELECTION-SCREEN BEGIN OF SCREEN 100 AS SUBSCREEN.
. . . . .
. . . . . .
SELECTION-SCREEN END OF SCREEN 100.
SELECTION-SCREEN BEGIN OF SCREEN 200 AS SUBSCREEN.
. . . .
. . .
SELECTION SCREEN END OF SCREEN 200.
SELECTION-SCREEN BEGIN OF TABBED BLOCK TABS FOR 30 LINES.
SELECTION-SCREEN TAB (20) TAB1_T USER-COMMAND TAB_1
DEFAULT SCREEN 100.
SELECTION-SCREEN TAB (25) TAB2_T USER-COMMAND TAB_2
DEFAULT SCREEN 200.
SELECTION-SCREEN END OF BLOCK TABS.
SELECTION-SCREEN: FUNCTION KEY 3. "Select All
SELECTION-SCREEN: FUNCTION KEY 4. "Deselect All
AT SELECTION-SCREEN.
CASE SY-UCOMM.
WHEN 'TAB_1.
TABS-DYNNR = 100.
CLEAR : SSCRFIELDS-FUNCTXT_03, SSCRFIELDS-FUNCTXT_04. "On using this statement, I expect the two buttons to disappear. But """they are NOT disappearing.
WHEN 'TAB_2'.'.
CLEAR GW_SEL_BUTTON.
GW_SEL_BUTTON-ICON_ID = ICON_SELECT_ALL.
GW_SEL_BUTTON-ICON_TEXT = 'Select All'.
SSCRFIELDS-FUNCTXT_03 = GW_SEL_BUTTON.
CLEAR GW_SEL_BUTTON.
GW_SEL_BUTTON-ICON_ID = ICON_DESELECT_ALL.
GW_SEL_BUTTON-ICON_TEXT = 'Deselect All'.
SSCRFIELDS-FUNCTXT_04 = GW_SEL_BUTTON.
CLEAR GW_SEL_BUTTON.
TABS-DYNNR = 200.
ENDCASE.
Thanks for your time and effort.