Skip to Content
0
Oct 25, 2012 at 05:18 AM

Problem in tabstrip

208 Views

Dear Experts,

I am facing one problem in tabstrip control. The module pool program is running. My initial active tab is first tab. I can switch from first tab to rest of tab. But I cant get back to first tab from others. OK_CODE dont have value while for others tab OK_CODE has corresponding value. It happens when I move back to first from others tab. Another thing, always active tab is first tab instead of I pressed others tab. Kindly advise how to resolve it.

My code is:

Main Program:

-------------------------------------------------------------------------------------------

REPORT ztab_strip.

CONTROLS: tab1 TYPE TABSTRIP.

DATA: gv_subscreen TYPE char4,
ok_code TYPE sy-ucomm.

*gv_subscreen = '1002'.
*tab1-activetab = 'TAB3'.
CALL SCREEN 1001.


*&---------------------------------------------------------------------*
*& Module STATUS_1001 OUTPUT
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
MODULE status_1001 OUTPUT.
SET PF-STATUS 'PF_1001'.
* SET TITLEBAR 'xxx'.
IF tab1-activetab IS INITIAL
OR gv_subscreen IS INITIAL.
tab1-activetab = 'TAB2'.
gv_subscreen = '1002'.
else.
tab1-activetab = ' '.
ENDIF.
ENDMODULE. " STATUS_1001 OUTPUT



*&---------------------------------------------------------------------*
*& Module USER_COMMAND_1001 INPUT
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
MODULE user_command_1001 INPUT.

CLEAR ok_code.
ok_code = sy-ucomm.
CASE ok_code.
WHEN '1ST'.
tab1-activetab = 'TAB2'.
gv_subscreen = '1002'.
WHEN '2ND'.
tab1-activetab = 'TAB3'.
gv_subscreen = '1003'.

WHEN '3RD'.
tab1-activetab = 'TAB4'.
gv_subscreen = '1004'.

WHEN '4TH'.
tab1-activetab = 'TAB5'.
gv_subscreen = '1005'.

WHEN 'EXITT'.
LEAVE TO SCREEN 0.
WHEN OTHERS.
ENDCASE.

ENDMODULE. " USER_COMMAND_1001 INPUT

Screen flow logic

-------------------------------------------------------------------------------------------

PROCESS BEFORE OUTPUT.

MODULE status_1001.
CALL SUBSCREEN sub1 INCLUDING sy-repid gv_subscreen.
*
PROCESS AFTER INPUT.
CALL SUBSCREEN sub1.
MODULE user_command_1001.

Regards,

Arindam Samanta.