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

Active tab-screen

TimVDB92
Participant
0 Likes
703

Hi,

How is it possible to know which tab-screen is active when the users clicks on F8.

I got this code to create the 2 tabs:

"Tab screens

selection-screen begin of tabbed block t1 for 10 lines.

selection-screen tab (38) tsc2

                           user-command tsc2

                           default screen 2000.

selection-screen tab (38) tsc3

                           user-command tsc3

                           default screen 3000.

selection-screen end   of block t1.

" Scherm wordt hier opgebouwd

"screen 2000

selection-screen begin of screen 2000 as subscreen.

selection-screen begin of block b01 with frame title text-b01.

parameters:

   p_path  type string,

   p_fname type string.

selection-screen end of block b01.

selection-screen end   of screen 2000.

"screen 3000

selection-screen begin of screen 3000 as subscreen.

selection-screen begin of block b02 with frame title text-b02.

parameters:

   p_ddicst    type string.

selection-screen end of block b02.

parameters:

   p_alv    radiobutton group gr1,

   p_endwnl radiobutton group gr1.

selection-screen end   of screen 3000.

initialization.

   tsc2 = 'File upload'.

   tsc3 = 'File download'.

start-of-selection.

    "Here I need to know which tab is active

1 ACCEPTED SOLUTION
Read only

Juwin
Active Contributor
0 Likes
661

Whenever you declare a tabbed block with a name, system creates a structure in the program with that name.

Here, since you have given the tabbed block name as T1, system creates a structure named T1 in your program with 3 fields - PROG, DYNNR, ACTIVETAB.

At start-of-selection, the field T1-ACTIVETAB, will give you the user command of the active tab; in your case it will either be TSC2 or TSC3.

Thanks,

Juwin

Hi,

How is it possible to know which tab-screen is active when the users clicks on F8.

I got this code to create the 2 tabs:

"Tab screens

selection-screen begin of tabbed block t1 for 10 lines.

selection-screen tab (38) tsc2

                           user-command tsc2

                           default screen 2000.

selection-screen tab (38) tsc3

                           user-command tsc3

                           default screen 3000.

selection-screen end   of block t1.

" Scherm wordt hier opgebouwd

"screen 2000

selection-screen begin of screen 2000 as subscreen.

selection-screen begin of block b01 with frame title text-b01.

parameters:

   p_path  type string,

   p_fname type string.

selection-screen end of block b01.

selection-screen end   of screen 2000.

"screen 3000

selection-screen begin of screen 3000 as subscreen.

selection-screen begin of block b02 with frame title text-b02.

parameters:

   p_ddicst    type string.

selection-screen end of block b02.

parameters:

   p_alv    radiobutton group gr1,

   p_endwnl radiobutton group gr1.

selection-screen end   of screen 3000.

initialization.

   tsc2 = 'File upload'.

   tsc3 = 'File download'.

start-of-selection.

    "Here I need to know which tab is active

1 REPLY 1
Read only

Juwin
Active Contributor
0 Likes
662

Whenever you declare a tabbed block with a name, system creates a structure in the program with that name.

Here, since you have given the tabbed block name as T1, system creates a structure named T1 in your program with 3 fields - PROG, DYNNR, ACTIVETAB.

At start-of-selection, the field T1-ACTIVETAB, will give you the user command of the active tab; in your case it will either be TSC2 or TSC3.

Thanks,

Juwin