Online Tutorials & Training Materials | STechies.com
Register Login

Coding of Tabstrip Control

|| 1

Coding of Tabstrip Control
Stechies

Tabstrip Control

CONTROLS tabstrip TYPE TABSTRIP.

DATA: okcode TYPE sy-ucomm,
dynnr TYPE sy-dynnr,
flag type flag,
active like tabstrip-activetab .


call SCREEN 100.

*&---------------------------------------------------------------------*
*& Module USER_COMMAND_0100 INPUT
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
MODULE USER_COMMAND_0100 INPUT.
data: lv_okcode type syucomm.

lv_okcode = okcode.
clear okcode.

case lv_okcode.
WHEN 'TAB1'.
dynnr = '0110'.
WHEN 'TAB2'.
dynnr = '0120'.
WHEN 'TAB3'.
dynnr = '0130'.
WHEN 'TAB4'.
dynnr = '0140'.
WHEN 'TAB5'.
"check authorization, if authorization fails
flag = 'X'. "set the global flag
active = 'TAB1'. "store active tab in global variable
dynnr = '0110'. "set the screen number
WHEN 'BACK' or 'EXIT'.
leave program.
ENDCASE.

IF lv_okcode(3) = 'TAB'.
tabstrip-activetab = lv_okcode.
ENDIF.

ENDMODULE. " USER_COMMAND_0100 INPUT
*&---------------------------------------------------------------------*
*& Module STATUS_0100 OUTPUT
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
MODULE STATUS_0100 OUTPUT.
SET PF-STATUS 'MAIN'.
* SET TITLEBAR 'xxx'.
IF tabstrip-activetab IS INITIAL OR
dynnr IS INITIAL.
tabstrip-activetab = 'TAB1'.
dynnr = '0110'.
ENDIF.
"set the activetab explicilty here
if flag eq 'X'. "from authorization failure
tabstrip-activetab = active. "'TAB1'
clear flag.
endif.

ENDMODULE. " STATUS_0100 OUTPUT


Comments

  • 24 Sep 2008 5:14 pm
    That's is the best

    Very cool to improving my report

    Very tanks!