Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Making a tab default in tabstrip

Former Member
0 Likes
2,874

Hi,I have an urgent requirement.

In a tabstrip of five tabs, how to make 3rd tab default.

I mean to say,if i am executing a program having such tabstrip then selection screen should open with fields defined in subscreen of third tab.

1 ACCEPTED SOLUTION
Read only

Former Member
1,436

This is the code i have written..but its not working:

*&---------------------------------------------------------------------*

*& Report  ZEXAMPLE

*&

*&---------------------------------------------------------------------*

*&

*&

*&---------------------------------------------------------------------*

REPORT  ZEXAMPLE

        NO STANDARD PAGE HEADING.

TABLES:sscrfields.

*---------------------------------------------------------------------*

*   Selection screen

*---------------------------------------------------------------------

*Selection screen for vendor1 and vendor2.

SELECTION-SCREEN: BEGIN OF TABBED BLOCK tab_block FOR 16 LINES,

                    TAB (23) button1 USER-COMMAND push1,      "#EC NEEDED

                    TAB (23) button2 USER-COMMAND push2       "#EC NEEDED

                    " etc

                    DEFAULT SCREEN 1001,

                    END OF BLOCK tab_block.

  SELECTION-SCREEN BEGIN OF SCREEN 1001 AS SUBSCREEN.

    SELECTION-SCREEN END OF SCREEN 1001.

    SELECTION-SCREEN BEGIN OF SCREEN 1002 AS SUBSCREEN.

    SELECTION-SCREEN END OF SCREEN 1002.

  " etc.

  INITIALIZATION.

    button1 = text-bu1.

    button2 = text-bu2.

    " etc.

    tab_block-prog = sy-repid.

    tab_block-dynnr = 1002.

    tab_block-activetab = 'BUTTON2'.

    " etc.

    AT SELECTION-SCREEN.

      CASE sscrfields-ucomm.

        WHEN 'PUSH1'.

          tab_block-dynnr = 1001.

          tab_block-activetab = 'TAB2'.

ENDCASE.         " etc.

Hi,I have an urgent requirement.

In a tabstrip of five tabs, how to make 3rd tab default.

I mean to say,if i am executing a program having such tabstrip then selection screen should open with fields defined in subscreen of third tab.

5 REPLIES 5
Read only

RaymondGiuseppi
Active Contributor
0 Likes
1,436

selection screen

Set active tab during INITIALIZATION as you do when you manage the function codes associated with tab header.

SELECTION-SCREEN: BEGIN OF TABBED BLOCK tab_block FOR 16 LINES,
                   TAB (23) button1 USER-COMMAND push1,      "#EC NEEDED
                   TAB (23) button2 USER-COMMAND push2       "#EC NEEDED
                   " etc
                   DEFAULT SCREEN 1001,
                   END OF BLOCK tab_block.
SELECTION-SCREEN BEGIN OF SCREEN 1001 AS SUBSCREEN.
" etc.

INITIALIZATION.
   button1 = text-bu1.
   button2 = text-bu2.
   " etc.
   tab_block-prog = sy-repid.
   tab_block-dynnr = 1002.
   tab_block-activetab = 'BUTTON2'.
   " etc.

   AT SELECTION-SCREEN.
     CASE sscrfields-ucomm.
       WHEN 'PUSH1'.
         tab_block-dynnr = 1001.
         tab_block-activetab = 'BUTTON1'.
         " etc.

Regards,

Raymond

Read only

Former Member
0 Likes
1,436

As Raymond mentioned above, ACTIVETAB = 'BUTTON NAME' is the one that will set a specific tab to be highlighted.

BUTTON NAME is the push button name you have assigned.

Read only

Former Member
1,437

This is the code i have written..but its not working:

*&---------------------------------------------------------------------*

*& Report  ZEXAMPLE

*&

*&---------------------------------------------------------------------*

*&

*&

*&---------------------------------------------------------------------*

REPORT  ZEXAMPLE

        NO STANDARD PAGE HEADING.

TABLES:sscrfields.

*---------------------------------------------------------------------*

*   Selection screen

*---------------------------------------------------------------------

*Selection screen for vendor1 and vendor2.

SELECTION-SCREEN: BEGIN OF TABBED BLOCK tab_block FOR 16 LINES,

                    TAB (23) button1 USER-COMMAND push1,      "#EC NEEDED

                    TAB (23) button2 USER-COMMAND push2       "#EC NEEDED

                    " etc

                    DEFAULT SCREEN 1001,

                    END OF BLOCK tab_block.

  SELECTION-SCREEN BEGIN OF SCREEN 1001 AS SUBSCREEN.

    SELECTION-SCREEN END OF SCREEN 1001.

    SELECTION-SCREEN BEGIN OF SCREEN 1002 AS SUBSCREEN.

    SELECTION-SCREEN END OF SCREEN 1002.

  " etc.

  INITIALIZATION.

    button1 = text-bu1.

    button2 = text-bu2.

    " etc.

    tab_block-prog = sy-repid.

    tab_block-dynnr = 1002.

    tab_block-activetab = 'BUTTON2'.

    " etc.

    AT SELECTION-SCREEN.

      CASE sscrfields-ucomm.

        WHEN 'PUSH1'.

          tab_block-dynnr = 1001.

          tab_block-activetab = 'TAB2'.

ENDCASE.         " etc.

Read only

0 Likes
1,436

Hi Kalprakash,

pass USER-COMMAND PUSH2 instead NAME of TAB BUTTON2:


tab_block-activetab = 'PUSH2'.

Regards,

Angelo.

Read only

Former Member
0 Likes
1,436

Thanks Angelo it is working fine.