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

Query regarding Tabstrip

Former Member
0 Likes
773

Hi All,

I have one small query regarding Tabstirp....

I have Tabstrip in the selection-screen with two tabs (Tab1 & Tab2). By default Tab1 is active when screen is displayed.

But I want to make Tab2 be active by default when screen in displayed.

Please note that i am asking this in selection-screen....

Regards,

Raghu

7 REPLIES 7
Read only

Former Member
0 Likes
740

hi

CONTROLS <ctrl> TYPE TABSTRIP.

where <ctrl> is the name of the tabstrip area on a screen in the ABAP program. The control allows the ABAP program to work with the tabstrip control. The statement declares a structure with the name <ctrl> . The only component of this structure that you need in your program is called ACTIVETAB.

  • Use in the PBO event

Before the screen is displayed, you use the control to set the tab page that is currently active. To do this, assign the function code of the corresponding tab title to the component ACTIVETAB:

<ctrl>-ACTIVETAB = <fcode>.

Regards

Sajid

Read only

raviahuja
Contributor
0 Likes
740

Hi Raghu,

Let below be the three tab strips in the following order currently:

SELECTION-SCREEN BEGIN OF TABBED BLOCK t1 FOR 20 LINES.
  SELECTION-SCREEN TAB (30) name1 USER-COMMAND ucomm1 DEFAULT SCREEN 101.
  SELECTION-SCREEN TAB (20) name2 USER-COMMAND ucomm2 DEFAULT SCREEN 102.
  SELECTION-SCREEN TAB (10) name3 USER-COMMAND ucomm3 DEFAULT SCREEN 103.
SELECTION-SCREEN END OF BLOCK t1.

Currently Tab with name1 default scree 1 is default.

If I want to make tab with name2 and default screen 2 as default, all I would do is:

SELECTION-SCREEN BEGIN OF TABBED BLOCK t1 FOR 20 LINES.
  SELECTION-SCREEN TAB (20) name2 USER-COMMAND ucomm2 DEFAULT SCREEN 102.  
  SELECTION-SCREEN TAB (30) name1 USER-COMMAND ucomm1 DEFAULT SCREEN 101.
  SELECTION-SCREEN TAB (10) name3 USER-COMMAND ucomm3 DEFAULT SCREEN 103.
SELECTION-SCREEN END OF BLOCK t1.

Hope it resolves the issue.

Regards,

Ravi

Read only

Former Member
0 Likes
740

Hi,



CONTROLS tabstrip TYPE TABSTRIP.
data: dynnr  TYPE sy-dynnr.

  IF tabstrip-activetab IS INITIAL OR
     dynnr IS INITIAL.
    tabstrip-activetab = 'TAB2'.
    dynnr = '0110'.
  ENDIF.

Edited by: Nitwick on Jul 9, 2009 12:36 PM

Read only

venkat_o
Active Contributor
0 Likes
740

Hi Raghu Raman,

Try this one. It works

REPORT zdemo_sel_screen_with_tabstrip.

DATA flag(1) TYPE c.

* SUBSCREEN 1
*CONTROLS mytabstrip TYPE TABSTRIP.
SELECTION-SCREEN BEGIN OF SCREEN 100 AS SUBSCREEN.
SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME.
PARAMETERS: p1(10) TYPE c,
            p2(10) TYPE c,
            p3(10) TYPE c.
SELECTION-SCREEN END OF BLOCK b1.
SELECTION-SCREEN END OF SCREEN 100.

* SUBSCREEN 2

SELECTION-SCREEN BEGIN OF SCREEN 200 AS SUBSCREEN.
SELECTION-SCREEN BEGIN OF BLOCK b2 WITH FRAME.
PARAMETERS: q1(10) TYPE c ,
            q2(10) TYPE c ,
            q3(10) TYPE c .
SELECTION-SCREEN END OF BLOCK b2.
SELECTION-SCREEN END OF SCREEN 200.

* STANDARD SELECTION SCREEN
"Tabstrip
SELECTION-SCREEN: BEGIN OF TABBED BLOCK mytab FOR 10 LINES,
                  TAB (20) button1 USER-COMMAND push1, "By default this one
                  TAB (20) button2 USER-COMMAND push2,
                  END OF BLOCK mytab.

"INITIALIZATION
INITIALIZATION.

  button1 = 'tab1'.
  button2 = 'tab2'.

  mytab-prog = sy-repid.
  mytab-dynnr = 200.
  mytab-activetab = 'PUSH2'. "Change to Tab 2

Thanks

Venkat.O

Read only

Former Member
0 Likes
740

Hi Venkat,

Thanks... its working.............. if my tabstrip is in the second screen and when i moving from 1st screen to second screen then its not working... How to solve this??

Regards,

Raghu

Read only

venkat_o
Active Contributor
0 Likes
740

Hi Raghu,

Use this below code


AT SELECTION-SCREEN.
  CASE sy-ucomm.
    WHEN 'PUSH1'.
      mytab-dynnr = 100.
      mytab-activetab = 'PUSH1'.
    WHEN 'PUSH2'.
      mytab-dynnr = 200.
      mytab-activetab = 'PUSH2'.
  ENDCASE.

Thanks

Venkat.O

Read only

Former Member
0 Likes
740

Hi Raghu,

u need to mention the DEFAULT SCREEN additionn while declaring the tabstrip.


"Tabstrip
SELECTION-SCREEN: BEGIN OF TABBED BLOCK mytab FOR 10 LINES,
                 TAB (20) button1 USER-COMMAND push1 default screen 100,
                 TAB (20) button2 USER-COMMAND push2 default screen 200,
                  END OF BLOCK mytab.

Regards