Application Development 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: 

How to get the active tab in a Tabstrip

michael_fallenbchel
Active Participant
0 Kudos

Hi experts,

I have a report included a dynpro (1001). On this dynpro I have a tabstrip (TAB_ALV) with 4 tabs (dynpro 1010, 1020, 1030 and 1040).

PBO for 1001:

CALL SUBSCREEN: sub_button   INCLUDING sy-repid '1010',
                   sub_layout   INCLUDING sy-repid '1020',
                   sub_spalte   INCLUDING sy-repid '1030',
                   sub_beispiel INCLUDING sy-repid '1040'.

Okay, everything is working. I can change tabs...

Now I have added in my TOP-include

CONTROLS tab_alv TYPE TABSTRIP.

because I want to know which tab is selected.

But when I try to debug my report (Dialog transaction with dynrpo 1001), the variant TAB_ALV is not assigned...

What am I doing wrong?

1 ACCEPTED SOLUTION

Former Member
0 Kudos

PBO stands for Processing Before Output

It is used to SET values not read values.  If you wanted to make a particular tab the active tab, you would do that here.

In PBO you should set the active tab to what ever you want it to be.

PAI stands for Processing After Input

This is where you need to look at what the active tab has been set to. Which actually is the value in sy-ucomm. 

Normally, you would setup a variable for this called w_pressed(or whatever you want to call it) then in PBO move that to the activetab field of the tabstrip.

12 REPLIES 12

0 Kudos

Hi Michael,

The Tabstrip contraol in the screen layout should have same name as  tab_alv.

Regards,

Rakesh.

0 Kudos

Hi Rakesh,

they have the same name:

Dynpro, Tabstrip called TAB_ALV

TOP include: CONTROLS tab_alv TYPE TABSTRIP.

Both called tab_alv

0 Kudos

Hi,did u used code in pbo,pai

use in pbo.

data:pressed type sy-ucomm.

  tab_alv-activetab = pressed.
case pressed.":for first time make it as TAB1 or TAB2.
  when 'TAB1'.
    screen = '201'
    .
    when 'TAB2'.
      screen = '202'.
    endcase.
in pai,,,

   case sy-ucomm.
  when 'TAB1'.
pressed = 'TAB1'.

   when 'TAB2'.
pressed = 'TAB2'.
endcase.

thanks

0 Kudos

Hi,

Well then there can be some logical error. check this demo program for help DEMO_DYNPRO_TABSTRIP_LOCAL.

Regards,

Rakesh

0 Kudos

The defintion of the tabstrip control is in the TOP include.

My break point is in the PBO... and here my variant TAB_ALV is not assigned.

So I can't make any changes to the tab_strip- activetab.

Also my report is a type M (Module Pool), I call it via transaction (type Dialog transaction, Screen number 1001).

0 Kudos

I have the same logic - expect that the demo program is a Executable program, I have a Module pool

0 Kudos

The processing is the same for both types of programs. This is a question about screen processing.

Former Member
0 Kudos

PBO stands for Processing Before Output

It is used to SET values not read values.  If you wanted to make a particular tab the active tab, you would do that here.

In PBO you should set the active tab to what ever you want it to be.

PAI stands for Processing After Input

This is where you need to look at what the active tab has been set to. Which actually is the value in sy-ucomm. 

Normally, you would setup a variable for this called w_pressed(or whatever you want to call it) then in PBO move that to the activetab field of the tabstrip.

0 Kudos

Sure, I know PAI/PBO...that's not the problem.

I make a break point now in my PAI (USERCOMMAND_1001), it isn't called when I change my tab. When I leave the program (Exit-command), I reach my breakpoint, also the control is assigned and my active tab is correct.

Okay, now I know that all all declarations are correct.

Last problem to solve is - how to call a PAI when changing a tab?

0 Kudos

in the screen painter each tab of the tabstrip has a set of attributes.  Make sure you have assigned a function code to each one. I think you also need to be sure Fct Type is set to <none> (blank)

0 Kudos

That's it! I have to make sure the Fct type is blank!

Then USercommand for dynpro 1001 will be called, I can check the sy-ucomm, change the activetab in my control manually - and can work with the active tab...

Thank you very much for your help

0 Kudos

Thanks!

I had the same problem.

The wizard filles FctType with the Value 'P' which causes problems later on.

(When you scroll in the second tab , you will automaticlly land in the first tab or when you hit enter in the second tab you will also then end up in the first tab and so on)

Now it is blank and everything works, thanks!