Sunday, November 17, 2013

TAW10 - Screen Elements: Subscreen and Tabstrib Control

SUBSCREEN (1)

A subscreen area is a reserved rectangular area on a screen, in which you add another screen during run time.
A second screen with the type subscreen must be created and then displayed in the subscreen area defined on the main screen. In other words, a subscreen is an independent screen displayed within another screen.


SUBSCREEN (2)

You can include multiple subscreens within a main screen. From a usability perspective, subscreens are highly attractive as different programs can use the same subscreens. You can also define the subscreens dynamically at run time.

SUBSCREEN AREA: ATTRIBUTE

The general attributes of the subscreen area include its name, position, and size.
You can use the resizing attributes to determine whether the size of a subscreen area can be changed vertically and horizontally. If a subscreen is bigger than the subscreen area in which it is called, then only that part of the subscreen which can fit in the subscreen area is shown.
You can also use the minimum size attribute to set the lowest possible limit to which the subscreen area can be resized.
Similarly, by using the scrollable attribute, the system displays scrollbars for large screen sizes.

CREATING A SUBSCREEN AREA



For creating a subscreen area, you need to
select a subscreen from the object list in the Screen Painter;

enter a name for the Subscreen area in the Object text field and position it on the screen;

adjust the top-left corner of the table control area; and

modify the size of the object.

CALLING A SUBSCREEN

It is essential to call a subscreen in both the PBO and PAI sections of the flow logic of the main screen. For this purpose, the ABAP modules for subscreens are programmed similarly as normal screens.
The CALL SUBSCREEN <subarea> statement executes the PBO and PAI processing blocks for the Subscreen as components of the PBO and PAI of the main screen.

SPESIAL CASE: VISIBILITY OF DATA



You must use the global fields of your ABAP program for the fields within the flow logic. These fields must be declared in the TOP include of your program.

SUBSCREEN FROM EXTERNAL PROGRAM



You cannot access the global data of the main program in the subscreen if it is not in the same module pool as the main program. In this case, data transfer from the screen to the program does not occur.
Therefore, you must implement data transfer through a function module that exports and imports data with an appropriate MOVE statement in the subscreen coding.

SUBSCREENS: ENCAPSULATION IN FUNCTION GROUP



There may be instances when you may need to use a single subscreen in the screens of several different programs. In such cases, you can encapsulate the subscreen in a function group and use function modules to transport data between the programs in which you want to use the subscreen and the function group. The interfaces of the function modules are used to pass the data between the calling program and the function group.

SUBSCREEN IN FUNCTION GROUP: CALL SEQUENCE

You should use a module prior to the subscreen call to exchange data between the calling program and the function group. A function module is called for this purpose. It must be called before the subscreen call so that data is known in the function group before the PROCESS BEFORE OUTPUT processing block of the subscreen is called.
The PROCESS AFTER INPUT processing block of the subscreen is called before the function module call to transport the data back from the function group to the calling program.

SUBSCREEN IN FUNCTION GROUP: DATA TRANSPORT

You can access the data of the calling program globally in the function group by transferring the interface parameters from the function module into global data fields of the function group. In order to transfer data from the function group to the calling program, the corresponding data from the global data of the function group must be copied into the interface parameters of the function module.

SCREEN ELEMENT: TABSTRIP CONTROLS

Tabstrip controls serve as a container for other screen objects. They also provide an intuitive way of navigating between different components of an application shown on a single screen.
You can use tabstrip controls to depict different components of an application that form a logical unit.


TABSTRIP ELEMENTS



A tabstrip control comprises individual pages with a tab page and a tab title.
If the tabstrip control contains multiple pages, a scrollbar allows you to scroll through the different tab pages when it is not possible to display all the tab titles simultaneously. You can also use a pushbutton to display a list of all of the tab titles with a checkmark next to the active tab title.
A tabstrip control also contains a border.

PAGE ELEMENT: TECHNICAL VIEW

A page element consists of a tab title, a subscreen area, and a subscreen. A tab title functions similar to a pushbutton. The subscreen technique is used to display the contents of the page elements. A subscreen area is assigned to each page element for which you can then call the subscreen.

TABSTRIP CONTROLS: ATTRIBUTE

The general attributes, such as Object name, Starting position, and Static size, determine the name, position, and size of the tabstrip control, respectively. The resizable attributes can be used to check whether the size can be changed vertically and horizontally. You can also use the minimum size attribute to set a lower limit beyond which the size cannot be changed.

CREATING A TABSTRIB CONTROL

A tabstrip control can be created by first defining the tab area. Then, a tab title is defined and additional tab titles can be added when required. A subscreen area is finally assigned to each page element.


CREATING A TABSTRIP CONTROL: TABSTRIP AREA


The first step in creating a Tabstrip Control is to define a tab area. You should first select Tabstrip Control from the object list in the screen painter and then place it on the screen.
You should then assign a name to the Tabstrip Control in the Object name attribute.
Next, in the ABAP program use the CONTROLS statement to declare an object with the same name with TABSTRIP as the type.
The type TABSTRIP is defined in the type pool CXTAB. The ACTIVETAB field holds the functions code of the tab title of the currently active Tabstrip.

CREATING A TABSTRIP CONTROL: TAB TITLE

Tab titles possess a name, a text, a function code, and a function type, which are entered in the Name, Text, FctCode, and FctType fields of the object attributes respectively.
A tab title either has the function type ‘ ’(space) or function type P. If the function type is a “(space)”, then the PAI processing block is called with user selection of tab and the function code is placed in the command field. On the other hand, the function type P allows the user to scroll between the different tab pages of the same type without triggering the PAI processing block.

CREATING TABSTRIP CONTROL: TABSTRIP SUBSCREEN

You must assign a Subscreen area to each screen element. The Subscreen area assigned to a tab page is automatically entered as the Reference object in the Dictionary attributes for the tab title of that page.
You can also assign a subscreen area to multiple tab pages. For this, select the relevant tab title in the full screen editor, and then place the Subscreen object on the tab page.

SCROLLING LOCALLY IN TABSTRIP CONTROL

You can scroll between the pages locally at the front end, if a different subscreen area is assigned to each page element in a tabstrip control. It is essential to send all the subscreens to the front end when you send the main screen. You must also ensure that all the tab titles in the tabstrip control have the function type P, so that the user can scroll between the different tab pages without triggering the PAI processing block.

SCROLLING IN LOCALLY TABSTRIP CONTROLS: PROGRAMMING

You must call all the subscreens from the flow logic and assign function type P to all the tab titles. The ABAP program uses the CONTROLS statement to declare an object with TYPE TABSTRIP.

PAI SCROLLING IN TABSTRIP CONTROLS

The program analyzes the function code of the chosen tab title to determine which screen is displayed when the page elements share a single subscreen area.
There are two steps in this process:
The program determines which page element should be active on the basis of the tab title chosen by the user in the PAI processing block.

The program displays the corresponding screen during the processing of the PBO block.


TABSTRIP CONTROLS: PROGRAMMING

The application program can process scrolling in a tabstrip control when
all the tab pages share a common subscreen area;

all the tab titles have the function code type ‘ ‘ (space);

a variable is used in the flow logic to call the screen for display in the subscreen area; and

the PAI block is used to call a module containing the function code of the active tab title placed in the ACTIVETAB field of the structure my_tab_strip created with type TABSTRIP.

It is also mandatory that the PBO processing block contains a module in which the name of the subscreen is placed in the corresponding variable.


TABSTRIP CONTROLS USING THE WIZARD

You can insert the tabstrip control on screens in a program using the Tabstrip Control Wizard. The wizard also creates the respective statements in the flow logic, along with the required modules, subroutines, and the data definitions.
Moreover, you can use the wizard to generate empty subscreens for the individual Tabstrip Control pages and Includes for data definition, PBO modules, PAI modules, and INCLUDE statements for these includes.

No comments:

Post a Comment