1

I set up a Tabstrip on a Dynpro. Ive got 2 Tabs. On each Tab I set a Subscreen.

0100 - Main Screen
0110 - Subscreen One
0120 - Subscreen Two

The tabstrip is defined with these attributes.

Tabs:

Title strip    Reference subscreen  Function code  Function type
Subscreen One  SUB1                 STP_CTGRY_TAB  P
Subscreen Two  SUB1                 TRAN_TAB       P

Subscreens (subscreen areas) :

SUB1

The dynpro 0100 flow logic is :

 PROCESS BEFORE OUTPUT.
   MODULE pbo.
   CALL SUBSCREEN sub1 INCLUDING sy-repid dynnr.
 PROCESS AFTER INPUT.
   CALL SUBSCREEN sub1.
   MODULE pai.

On program level I declare.

CONTROLS mytabstrip TYPE TABSTRIP.
DATA: ok_code          LIKE sy-ucomm,
  dynnr            TYPE sy-dynnr.

At Main Screen 0100 PBO:

IF mytabstrip-activetab IS INITIAL OR dynnr IS INITIAL.
  mytabstrip-activetab = 'STP_CTGRY_TAB'.
  dynnr = '0110'.
ENDIF.

At Main Screen 0100 PAI:

CASE ok_code.
 WHEN 'STP_CTGRY_TAB'.
  dynnr = '0110'.
  mytabstrip-activetab = ok_code.
 WHEN 'TRAN_TAB'.
  dynnr = '0120'.
  mytabstrip-activetab = ok_code.
ENDCASE.

If I debug my program and set breakpoints the tabstrip works. Bur if I run the program and change the tab of the tabstrip it seems that the subscreen freezes and overlaps the subscreen which should be displayed. All in all the changes on the tab doesn't work.

Did I forget any code? Can anyone help me what I possibly missed?

Sandra Rossi
  • 11,934
  • 5
  • 22
  • 48
Lingo
  • 580
  • 2
  • 7
  • 26

1 Answers1

1

REASON:

  • The function types of the 2 tabs are defined with the value "P", meaning that the tabstrip works using "local paging", so it needs to work with 2 subscreen areas referring each to one distinct subscreen, so that the actions on the tabs work as expected.

  • There are two types of usage of a tabstrip.

    1. Use one subscreen for all tabs ("server paging") So you have to load each data new if the users clicks on a tab.

    2. Use one subscreen for each tab ("local paging") The whole data will be loaded at the beginning of the program.
      NOTE: In the screen layout editor you have to set the parameter FctType to P - local GUI func.

RESOLUTION:

If you want to use the server paging (1), let the function type empty like this :

Title strip    Reference subscreen  Function code  Function type
Subscreen One  SUB1                 STP_CTGRY_TAB  
Subscreen Two  SUB1                 TRAN_TAB       

The dynpro 0100 flow logic is :

PROCESS BEFORE OUTPUT.
  MODULE pbo.
  CALL SUBSCREEN sub1 INCLUDING sy-repid dynnr.
PROCESS AFTER INPUT.
  CALL SUBSCREEN sub1.
  MODULE pai.

In the PBO and PAI modules, define ABAP code to initialize the DYNNR and MYTABSTRIP-ACTIVETAB variables to the right values, as shown in the initial question.

If you want to use the local paging (2), do as follows :

Tabs:

Title strip    Reference subscreen  Function code  Function type
Subscreen One  SUB1                 STP_CTGRY_TAB  P
Subscreen Two  SUB2                 TRAN_TAB       P

Subscreens (subscreen areas) :

SUB1
SUB2

The dynpro 0100 flow logic is :

PROCESS BEFORE OUTPUT.
  MODULE pbo.
  CALL SUBSCREEN sub1 INCLUDING sy-repid '0110'.
  CALL SUBSCREEN sub2 INCLUDING sy-repid '0120'.
PROCESS AFTER INPUT.
  CALL SUBSCREEN sub1.
  CALL SUBSCREEN sub2.
  MODULE pai.

In the local paging scenario, no ABAP code is needed in the PBO and PAI modules to switch between tabs because it's handled locally on the SAP GUI.

More information here : https://help.sap.com/saphelp_nw70/helpdata/en/17/5bf1b52ba211d2954f0000e8353423/frameset.htm

Sandra Rossi
  • 11,934
  • 5
  • 22
  • 48
Lingo
  • 580
  • 2
  • 7
  • 26