2005 Aug 23 8:15 AM
hi all,
I have declared a TabStrip with Four tabs I wanted to Display Second Tab to the user at Run Time. Is it possible? and How?
Thanks.
2005 Aug 23 8:28 AM
IN PBO b4 calling subscreen
set the below value & call
<tabstrip>-activetab = tab2
regds
gv
hi all,
I have declared a TabStrip with Four tabs I wanted to Display Second Tab to the user at Run Time. Is it possible? and How?
Thanks.
2005 Aug 23 8:24 AM
Hi Sanjay,
Sure you can; the control you defined for your tabstrip has an attribute 'activetab'. Just set this attribute in the PBO of the screen.
Regards,
John.
2005 Aug 23 8:28 AM
IN PBO b4 calling subscreen
set the below value & call
<tabstrip>-activetab = tab2
regds
gv
2005 Aug 23 9:07 AM
Hi,
Make the defaukt tab setting as Tab2.
[code]CONTROLS: main_tab TYPE TABSTRIP.
DATA: BEGIN OF i_main_tab,
subscreen LIKE sy-dynnr,
prog LIKE sy-repid VALUE
'ZZZ_TEST',
<b>pressed_tab LIKE sy-ucomm
VALUE c_main_tab-tab2</b>,
END OF i_main_tab.
MODULE main_tab_active_tab_set OUTPUT.
main_tab-activetab = i_main_tab-pressed_tab.
CASE i_main_tab-pressed_tab.
WHEN c_main_tab-tab1.
* To display report
i_main_tab-subscreen = '9100'.
CALL METHOD o_alvgrid1->set_table_for_first_display
EXPORTING
is_variant = w_variant
i_save = c_lay
is_layout = w_layout
CHANGING
it_outtab = i_output1[]
it_fieldcatalog = i_fieldcat[]
EXCEPTIONS
invalid_parameter_combination = 1
program_error = 2
too_many_lines = 3
OTHERS = 4.
IF sy-subrc <> 0.
MESSAGE i000 WITH text-e06."Error in ALV report display
LEAVE LIST-PROCESSING.
ENDIF.
WHEN c_main_tab-tab2.
* To display report
i_main_tab-subscreen = '9200'.
CALL METHOD o_alvgrid2->set_table_for_first_display
EXPORTING
is_variant = w_variant
i_save = c_lay
is_layout = w_layout
CHANGING
it_outtab = i_output2[]
it_fieldcatalog = i_fieldcat1[]
EXCEPTIONS
invalid_parameter_combination = 1
program_error = 2
too_many_lines = 3
OTHERS = 4.
IF sy-subrc <> 0.
MESSAGE i005 WITH text-e06."Error in ALV report display
LEAVE LIST-PROCESSING.
ENDIF.
WHEN OTHERS.
* DO NOTHING
ENDCASE.
ENDMODULE. MAIN_TAB_ACTIVE_TAB_SET OUTPUT
*&---------------------------------------------------------------------*
*& Module MAIN_TAB_ACTIVE_TAB_GET INPUT
*&---------------------------------------------------------------------*
* Check & Process the selected Tab
*----------------------------------------------------------------------*
MODULE main_tab_active_tab_get INPUT.
CASE sy-ucomm.
WHEN c_main_tab-tab1.
i_main_tab-pressed_tab = c_main_tab-tab1.
WHEN c_main_tab-tab2.
i_main_tab-pressed_tab = c_main_tab-tab2.
WHEN OTHERS.
* DO NOTHING
ENDCASE.
ENDMODULE. MAIN_TAB_ACTIVE_TAB_GET INPUT
*&---------------------------------------------------------------------*
*& Module USER_COMMAND_9001 INPUT
*&---------------------------------------------------------------------*
* User Command
*----------------------------------------------------------------------*
MODULE user_command_9001 INPUT.
CASE sy-ucomm.
WHEN 'BACK'.
PERFORM exit_program.
SET SCREEN '0'.
WHEN 'EXIT' OR 'CANC'.
PERFORM exit_program.
LEAVE PROGRAM.
ENDCASE.
ENDMODULE. USER_COMMAND_9000 INPUT
*&---------------------------------------------------------------------*
*& Module MAIN_TAB_ACTIVE_TAB_SET INPUT
*&---------------------------------------------------------------------*
* Set sunscreen
*----------------------------------------------------------------------*
MODULE main_tab_active_tab_set INPUT.
main_tab-activetab = i_main_tab-pressed_tab.
CASE i_main_tab-pressed_tab.
WHEN c_main_tab-tab1.
i_main_tab-subscreen = '9100'.
WHEN c_main_tab-tab2.
i_main_tab-subscreen = '9200'.
WHEN OTHERS.
* DO NOTHING
ENDCASE.
ENDMODULE. MAIN_TAB_ACTIVE_TAB_SET INPUTTry this out.
This is a sample for two tabs.