This is how we do tab strip control programming :
1. First go to se38 and create any program : say ZRG_TABSTRIP
Now code inside this program is below:
REPORT ZRG_TABSTRIP.
......................................................................................
CONTROLS MYTABSTRIP TYPE TABSTRIP.
CONTROLS tb1 type TABLEVIEW USING SCREEN 110.
.........................................................................................
DATA: OK_CODE TYPE SY-UCOMM,
SAVE_OK TYPE SY-UCOMM.
DATA : itab1 like mara OCCURS 0 with HEADER LINE.
DATA : lines TYPE I.
..........................................................
CALL SCREEN 100.
..........................................................
MODULE STATUS_0100 OUTPUT.
SET PF-STATUS 'SCREEN_100'.
ENDMODULE.
...........................................................
MODULE CANCEL INPUT.
LEAVE PROGRAM.
ENDMODULE.
.............................................................
MODULE USER_COMMAND_0100 INPUT.
SAVE_OK = OK_CODE.
CLEAR OK_CODE.
IF SAVE_OK = 'OK'.
MESSAGE I888(SABAPDOCU) WITH 'MYTABSTRIP-ACTIVETAB =' MYTABSTRIP-ACTIVETAB.
ENDIF.
if sy-ucomm = 'TAB1'.
MYTABSTRIP-ACTIVETAB = 'TAB1'.
endif.
IF sy-ucomm = 'TAB2'.
MYTABSTRIP-ACTIVETAB = 'TAB2'.
endif.
if sy-ucomm = 'TAB3'.
mytabstrip-activetab = 'TAB3'.
ENDIF.
if save_ok = 'BACK' OR SAVE_OK = 'EXIT' OR SAVE_OK = 'CANCEL'.
LEAVE PROGRAM.
ENDIF.
ENDMODULE.
...........................................................................
MODULE USER_COMMAND_0110 INPUT.
IF SY-UCOMM = 'GETDATA'.
SELECT * FROM MARA INTO CORRESPONDING FIELDS OF TABLE ITAB1.
ENDIF.
ENDMODULE.
.........................................................................
MODULE STATUS_0110 OUTPUT.
* SET PF-STATUS 'xxxxxxxx'.
* SET TITLEBAR 'xxx'.
ENDMODULE.
......................................................................
****************************************
Now goto se51 :
create 3 subscreen with same program name above mentioned
say: subscreen1 , subscreen2 , subscreen3.
and also create main screen say 100.
*********************************************
Flow logic of main screen 100:
..................................................
MODULE STATUS_0100.
..............................................................
CALL SUBSCREEN: SUBSCREEN1 INCLUDING SY-REPID '0110',
SUBSCREEN2 INCLUDING SY-REPID '0120',
SUBSCREEN3 INCLUDING SY-REPID '0130'.
*PROCESS AFTER INPUT.
..........................................................................
MODULE CANCEL AT EXIT-COMMAND.
CALL SUBSCREEN: SUBSCREEN1, SUBSCREEN2, SUBSCREEN3.
MODULE USER_COMMAND_0100.
.................................................
1. First go to se38 and create any program : say ZRG_TABSTRIP
Now code inside this program is below:
REPORT ZRG_TABSTRIP.
......................................................................................
CONTROLS MYTABSTRIP TYPE TABSTRIP.
CONTROLS tb1 type TABLEVIEW USING SCREEN 110.
.........................................................................................
DATA: OK_CODE TYPE SY-UCOMM,
SAVE_OK TYPE SY-UCOMM.
DATA : itab1 like mara OCCURS 0 with HEADER LINE.
DATA : lines TYPE I.
..........................................................
CALL SCREEN 100.
..........................................................
MODULE STATUS_0100 OUTPUT.
SET PF-STATUS 'SCREEN_100'.
ENDMODULE.
...........................................................
MODULE CANCEL INPUT.
LEAVE PROGRAM.
ENDMODULE.
.............................................................
MODULE USER_COMMAND_0100 INPUT.
SAVE_OK = OK_CODE.
CLEAR OK_CODE.
IF SAVE_OK = 'OK'.
MESSAGE I888(SABAPDOCU) WITH 'MYTABSTRIP-ACTIVETAB =' MYTABSTRIP-ACTIVETAB.
ENDIF.
if sy-ucomm = 'TAB1'.
MYTABSTRIP-ACTIVETAB = 'TAB1'.
endif.
IF sy-ucomm = 'TAB2'.
MYTABSTRIP-ACTIVETAB = 'TAB2'.
endif.
if sy-ucomm = 'TAB3'.
mytabstrip-activetab = 'TAB3'.
ENDIF.
if save_ok = 'BACK' OR SAVE_OK = 'EXIT' OR SAVE_OK = 'CANCEL'.
LEAVE PROGRAM.
ENDIF.
ENDMODULE.
...........................................................................
MODULE USER_COMMAND_0110 INPUT.
IF SY-UCOMM = 'GETDATA'.
SELECT * FROM MARA INTO CORRESPONDING FIELDS OF TABLE ITAB1.
ENDIF.
ENDMODULE.
.........................................................................
MODULE STATUS_0110 OUTPUT.
* SET PF-STATUS 'xxxxxxxx'.
* SET TITLEBAR 'xxx'.
ENDMODULE.
......................................................................
****************************************
Now goto se51 :
create 3 subscreen with same program name above mentioned
say: subscreen1 , subscreen2 , subscreen3.
and also create main screen say 100.
*********************************************
Flow logic of main screen 100:
..................................................
MODULE STATUS_0100.
..............................................................
CALL SUBSCREEN: SUBSCREEN1 INCLUDING SY-REPID '0110',
SUBSCREEN2 INCLUDING SY-REPID '0120',
SUBSCREEN3 INCLUDING SY-REPID '0130'.
*PROCESS AFTER INPUT.
..........................................................................
MODULE CANCEL AT EXIT-COMMAND.
CALL SUBSCREEN: SUBSCREEN1, SUBSCREEN2, SUBSCREEN3.
MODULE USER_COMMAND_0100.
.................................................
No comments:
Post a Comment