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

subscreen logic

Former Member
0 Likes
322

hi all,

i have the following code in my main screen 3000.

process before output.

module read_data_3000.

module status_3000.

call subscreen subscr_hu including 'ZTEST' number1.

process after input.

module pai_at_exit_3000 at exit-command.

call subscreen subscr_hu.

module user_command_3000.

i have two tabstrips. the default is in subscreen 3010 and the second is in 3020.

when iam click on tab2 , the logic jumps to PAI of teh main screen shown above and then at the statement 'call subscreen subscr_hu.' the flow goes to PBO of my first tab (3010)again. why is this?

is it becuase of the same subscreen area i have for two tab strips?

if i define separate subscreen areas for the two tabs would it be different/ would i have any problems?

FYI.the user can change data in my screens.

1 REPLY 1
Read only

Former Member
0 Likes
285

You need to set your active tab in the PBO of your main screen and get your active tab in the PAI of the main screen as follows


*---------------------
process before output.
*---------------------

*-- PBO flow logic for tabstrip 'MAINSCREENTAB'
  module mainscreentab_active_tab_set.
*-- include the subscreen for the selected tab
  call subscreen mainscreentab_sca
    including s_mainscreentab-prog s_mainscreentab-subscreen.
*-- set the status
  module status_0100.
*-- Initialize variables
  module initialize_data_on_scr_0100.

*-------------------
process after input.
*-------------------

*-- When Exit function keys are pressed
  module exit_100 at exit-command.
*-- PAI flow logic for tabstrip 'MAINSCREENTAB'
  module mainscreentab_active_tab_get.
*-- call the subscreen
  call subscreen mainscreentab_sca.
*-- Process based on user command
  module user_command_0100.

Module set_active_tab has the following logic


  mainscreentab-activetab = s_mainscreentab-pressed_tab.
  case s_mainscreentab-pressed_tab.
    when c_mainscreentab-tab1.
      s_mainscreentab-subscreen = '0200'.
    when c_mainscreentab-tab2.
      s_mainscreentab-subscreen = '0300'.
    when c_mainscreentab-tab3.
      s_mainscreentab-subscreen = '0400'.
    when others.
*-- Do Nothing
  endcase.

module get active tab code is


  v_ok_code = sy-ucomm.
  case v_ok_code.
    when c_mainscreentab-tab1.
      s_mainscreentab-pressed_tab = c_mainscreentab-tab1.
    when c_mainscreentab-tab2.
      s_mainscreentab-pressed_tab = c_mainscreentab-tab2.
    when c_mainscreentab-tab3.
      s_mainscreentab-pressed_tab = c_mainscreentab-tab3.
    when others.
*-- Do Nothing
  endcase.

s_mainscreentab is defined as follows


data: begin of s_mainscreentab,
        subscreen   like sy-dynnr,
        prog        like sy-repid value <YOUR PROGRAM>,
        pressed_tab like sy-ucomm value c_mainscreentab-tab1.
data: end of s_mainscreentab.

controls:  mainscreentab type tabstrip.

MAINSCREENTAB is my tabstrip control, 0100 is my main screen, MAINSCREENTAB_TAB1, MAINSCREENTAB_TAB2, MAINSCREENTAB_TAB3 are the individual tabs.

In the attributes of the individual tabs I have function code 'MAINSCREENTAB_FC1' set for tab 1, MAINSCREENTAB_SCA in the reference field attribute. MAINSCREENTAB_SCA is the name of my subscreen.

Did you create this using the wizard? Anyway, if you have all the steps above, you should be good to go. Please let me know, if you have any questions in this regard.

Srinivas