Skip to Content
-1

Several Subscreens in a report

Jul 25, 2017 at 07:22 AM

57

avatar image

Hello guys,

I'm trying to create a custom report which contains one start screen (main dynpro 100) and a subscreen (dynpro 200) on which a tabstrip is placed. Additional I have several subscreens that can be called by switching the tab of a tabstrip placed on subscreen dynpro 200. The several tabs got their own dynpro number, e.g. 201, 202, 203, and so on.

Now I have some problems with the dynpro processing. At the moment my dynpro processing for dynpro 100 and 200 looks like:

PROCESS BEFORE OUTPUT.
  MODULE status_0100.
  CALL SUBSCREEN sc_0200 INCLUDING 'ZCUSTOMREP' '0200'.

PROCESS AFTER INPUT.
  CALL SUBSCREEN sc_0200.
  MODULE user_command_0100.
PROCESS BEFORE OUTPUT.
  MODULE status_0200.

  CALL SUBSCREEN tab_001 INCLUDING 'ZCUSTOMREP' '0201'.
  CALL SUBSCREEN tab_002 INCLUDING 'ZCUSTOMREP' '0202'.
  CALL SUBSCREEN tab_003 INCLUDING 'ZCUSTOMREP' '0203'.
  
PROCESS AFTER INPUT.
  MODULE user_command_0200.
  CALL SUBSCREEN tab_001.
  CALL SUBSCREEN tab_002.
  CALL SUBSCREEN tab_003.  <br>

Of course that works, but it means that every subscreen dynpro with its PBO and PAI gets called every time. But I only want the selected tab dynpro to be called. At the moment I have a check argument placed in every tab subscreen routine which compares with the selected tab, but I think that can be done easier?!

Does anybody have an idea about that? I do not have that much knowledge about dynpro sequence programming, so maybe the solution is quite easy. I tried to call the subscreens within the report source where the tab gets selected, but it looks like that it is only possible for normal screens but not for subscreens.


Thanks a lot!

Regards

Michael

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

2 Answers

Best Answer
Rashid Javed Jul 25, 2017 at 07:39 AM
0

Following code is from ABAP documentation and i believe it is only calling the relevant tab screen.

Example

If, on a dynpro, a tabstrip control is defined with three untyped tab titles with the function codes "TAB1", "TAB2", and "TAB3" and a subscreen area SUB, the scrolling can be programmed in ABAP as follows. In a PBO module, prepare_tabstrip, the component activetab of the structure tab_strip created using CONTROLS is assigned the function code of the first tab title. After a tab title has been selected, this component is set to the relevant function code in the PAI module handle_user_command. The number of the desired subscreen dynpro is assigned to the data object dynnr that is used for including the subscreen in the dynpro flow logic. The associated programming of the dynpro flow logic can be seen in the example for CALL SUBSCREEN.

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

MODULE prepare_tabstrip OUTPUT. 
  IF tab_strip-activetab IS INITIAL OR 

     dynnr IS INITIAL. 
    tab_strip-activetab = 'TAB1'. 
    dynnr = 
'0110'. 
  ENDIF. 
ENDMODULE. 
MODULE handle_user_command INPUT. 

  CASE ok_code. 
    WHEN 'TAB1'. 
      dynnr = '0110'. 
    WHEN 
'TAB2'. 
      dynnr = '0120'. 
    WHEN 'TAB3'. 
      dynnr = '0130'. 

    ... 
  ENDCASE. 
  IF ok_code(3) = 'TAB'. 

    tab_strip-activetab = ok_code. 
  ENDIF. 
ENDMODULE. 

For PBO and PAI check the following logic.

Note that is only calling the sub screen that is in active tab. no need to call all subscreens.

PROCESS BEFORE OUTPUT. 
  MODULE prepare_tabstrip. 
  CALL 
SUBSCREEN sub INCLUDING sy-repid dynnr. 
PROCESS 
AFTER INPUT. 
  CALL SUBSCREEN sub. 
  MODULE handle_user_command.

Hope this solves your issue.

Share
10 |10000 characters needed characters left characters exceeded
Michael Boguth Jul 25, 2017 at 08:05 AM
0

Hello Rashid,

thanks a lot, that looks good. But i still have one problem. In this example at the end it is "CALL SUBSCREEN sub". sub is the reference field of every tab in the tabstrip. I named them different for every subscreen, e.g. TAB1_SUB, TAB2_SUB, and so on. How can I do the Subscreen call dynamically? Or can I put the same reference field in every tab?

Regards

Michael

Show 1 Share
10 |10000 characters needed characters left characters exceeded

You can put same in every tab. For reference,in SE80, if you goto menu Utilities -> Settings it opens a popup window with many tabs like WorkBench, ABAP Editor, Class Builder, etc.

The program behind this is function group WB_CUSTOMIZING. If you open it in SE80 and check its screen 0999 you will see the tabstrip and common area called TOOLAREA. At runtime the program decided what tab is clicked and what subscreen to show by this statement

  CALL SUBSCREEN toolarea

       INCLUDING g_0999_data-subprogram g_0999_data-subscreen.

here g_0999_data-subscreen actually contains the number of subscreen to be called. For more understanding, i suggest to put a break-point inside any pbo module of this screen 0999. Then call the Utilities -> Setting to see how g_0999_data-subscreen got changed dynamically based on tab selection.

0