Subscreen Tab Strips in ABAP Lesson Forty One

A sub screen area is a reserved rectangular area on a screen, into which you place another screen at run time. Sub screen areas may not contain any other screen elements. To use a sub screen, you create a second screen (with the type sunscreen), and display it in the sub screen area you defined on the main screen.A sub screen is an independent screen that you display within another screen. You may want to use a sub screen as a way of displaying a group of objects in certain circumstances, but not in others. You can use this technique to display or hide extra fields on the main screen, depending on the entries the user has made.A second use for sub screens is that different programs can use the same sub screens. To do this, you must execute other screen programs within your main program.You can include more than one sub screen on a single main screen. You can also determine the sub screens dynamically at run time.

You can use sub screens in the following circumstances:

In screen enhancements (screen exits), Within other screen objects (tabstrip control)
In the Modification Assistant In Web transactions.

If the sub screen is larger than the sub screen area in which it is called, the system only displays as much of it as will fit onto the screen. However, you can use the Scrollable attribute to ensure that, if the screen is too big, the system will display scroll bars.

The resizing attributes control whether the size of a sub screen area can be changed vertically and horizontally. You should set these attributes if you want the size of the sub screen area to change with the size of the whole window. You can use the minimum size attribute to set a lower limit beyond which the sub screen area cannot be re sized.The Context menu attribute allows you to assign a context-sensitive menu to the output fields on the sub screen screen.

The following restrictions apply to sub screens:

CALL SUBSCREEN ... is not allowed between LOOP and ENDLOOP or between
CHAIN and ENDCHAIN.

A sub screen may not have a named OK_CODE field.
Object names must be unique within the set of all sub screens called in a single main screen.

Sub screens may not contain a module with the AT EXIT-COMMAND addition.
You cannot use the SET TITLEBAR, SET PF-STATUS, SET SCREEN, or LEAVE
SCREEN statements in the modules of a sub screen.

To create a sub screen area, choose subscreen from the object list in the Screen Painter and place it on the screen. Fix the top-left hand corner of the table control area, and then drag the object to the required size.

In the Object text field, enter a name for the sub screen area. You need this to identify the area when you call the sub screen.

To use a sub screen, you must call it in both the PBO and PAI sections of the flow logic of the main screen. The CALL SUBSCREEN statement tells the system to execute the PBO and PAI processing blocks for the sub screen as components of the PBO and PAI of the main screen. You program the ABAP modules for sub screens in the same way as for a normal screen (apart from the restrictions already mentioned).

If the sub screen is not in the same module pool as the "main program", the global data of the main program is not available to the sub screen, and the data from the screen will not be transferred back to the program. You must program the data transfer yourself (for example, using a function module that exports and imports data, with an appropriate MOVE statement in the sub screen coding).

If you want to use sub screens in the screens of several different programs, you should encapsulate the sub screens in a function group and use function modules to transport data between the program in which you want to use the sub screen and the function group.You can pass data between the calling program and the function group using the interfaces of the function modules.This is the technique used for customer sub screens (screen enhancements).You use function modules to transport data between the calling program and the function group.

To declare the data from the calling program to the sub screen of the function group, use a module before the sub screen call. This should call a function module whose interface you can use to pass the required data to the function group.

The function module call must occur before the sub screen call. This ensures that the data is known in the function group before the PROCESS BEFORE OUTPUT processing block of the sub screen is called.

In the PAI module of the calling screen, the sequence is reversed: You call the PROCESS AFTER INPUT processing block of the sub screen before calling a function module to pass the data from the function group back to the calling program.For the data from the calling program to be available globally in the function group, you must transfer the interface parameters from the function module into global data fields of the function group.The function module that you use to transfer the data from the calling program into the function group must copy its interface parameters into the global data in the function group.

The function module that you use to transfer data from the function group to the calling program must copy the corresponding data from the global data of the function group into its interface parameters.Tab strip controls provide you with an easy, user-friendly way of displaying different components of an application on a single screen and allowing the user to navigate between them. Their intuitive design makes navigation much easier for end users.

Tab strip controls are a useful way of simplifying complex applications. You can use tab strip controls wherever you have different components of an application that form a logical unit. For example, you might have a set of header data which remains constant, while underneath it, you want to display various other sets of data.

You should not use tab strip controls if

You need to change the screen environment (menus, push buttons, header data, and so on) while processing the application components. The screen surrounding the tab strip must remain constant.The components must be processed in a certain order. Tab strips are designed to allow users to navigate freely between components.The components are processed dynamically, that is, if user input on one tab page leads to other tab pages suddenly appearing.

Tab strip controls are compatible with batch input processing.A tab strip control consists of individual pages. These consist of the page area and the tab title.The tab may only have one row of tab titles.If the tab strip control contains too many pages, it will not be possible for all of the tab titles to be displayed at once. If this happens, the system displays a scroll bar with which you can scroll through the remaining tab pages. In the top right-hand corner of the tab is a push button. If the user clicks this, a list of all of the tab titles is displayed. The active tab title is marked with a tick.A tab strip control consists of individual pages. These consist of the page area and the tab title.The tab may only have one row of tab titles.

If the tab strip control contains too many pages, it will not be possible for all of the tab titles to be displayed at once. If this happens, the system displays a scroll bar with which you can scroll through the remaining tab pages. In the top right-hand corner of the tab is a push button. If the user clicks this, a list of all of the tab titles is displayed. The active tab title is marked with a tick.A tab page consists of a tab title, a sub screen area, and a sub screen.From a technical point of view, the system handles tab titles like push buttons.The contents of tab pages are displayed using the sub screen technique. You assign a sub screen area to each tab page, for which you can then call a sub screen.

As well as the general "Object name", "Starting position" and static size attributes, tab strip controls also have special tab strip attributes.You create a tab strip control in the following three steps:

  1. Define the tab area
  2. Define the tab titles and, if necessary, add further tab titles
  3. Assign a sub screen area to each tab page.

To create a tab strip area, choose Tab strip from the object list in the Screen Painter and place it on the screen. Fix the top-left hand corner of the table control area, and then drag the object to the required size.Assign a name to the tab strip control in the "Object name" attribute. You need this name to identify your tab strip control.

In your ABAP program use the CONTROLS statement to declare an object with the same name. Use TAB STRIP as the type.The type TAB STRIP is defined in the type pool CXTAB. The field ACTIVETAB contains the function code of the tab title of the currently active tab page. The other fields are reserved for internal use.The default number of tab pages for a tab strip control is two.

Technically, tab titles are treated in the same way as push buttons. They have an object name, a text, a function code, and a function type. You enter these in the "Object name", "Object Text", "FctCode" and "FctType" fields of the obje ct attributes.

A tab title can have the function type ' ' (space) or 'P'. If the function type is ' ' (space), the PAI processing block is triggered when the user chooses that tab, and the function code of the tab title is placed in the OK_CODE field. If the function type is 'P', the user can scroll between the different tab pages with the same type without the PAI processing block being triggered. For further details, refer to the following pages.If you want your tab strip control to have more than two pages, you must create further tab titles. To do this, choose Push button from the object list in the Screen Painter and place it in the tab title area.You must assign a sub screen area to each tab page.The sub screen area assigned to a tab page is automatically entered as the "Reference object" (in the Dictionary attributes) for the tab title of that page.

To assign a sub screen area to one or more tab pages, choose the relevant tab title in the full screen editor, choose the Sub screen object, and place it on the tab page.Alternatively, you can assign a single sub screen area to several tab pages by entering the name of the sub screen area directly in the "Reference object" field of the attributes of the relevant tab pages.If you have assigned a different sub screen area to each tab page in a tab strip control, you can scroll between the pages locally at the front end.To do this, you must send all of the sub screens to the front end when you send the main screen itself.All of the tab titles in the tab strip control must also have function type 'P'.

Now, when you scroll between the different tab pages, there is no communication between the presentation server and the application server.When the user chooses a function on the screen that triggers PAI processing, the system processes the PAI blocks of all of the sub screens as well. This means that all of the field checks are run. In this respect, you could regard the tab strip control as behaving like a single large screen.Local scrolling in tab strip controls is more appropriate for display transactions.

To program a tab strip control to scroll locally at the front end, you must:

Assign a separate sub screen area to each tab page; a sub screen will be sent to each of these when the screen is processed.Call all of the sub screens from the flow logic.Assign function code type 'P' to all of the tab titles.

The system hides any tab page whose sub screen contains no elements that can be displayed.If there are no tab pages containing elements that can be displayed, the system hides the entire tab strip control.

If all of the tab pages share a single sub screen area, the program analyzes the function code of the chosen tab title to determine which screen is displayed.

There are two steps in this process:

In the PAI processing block, the program determines which tab page needs to be active, based on the tab title chosen by the user.

When the PBO processing block is processed again, the program displays the corresponding Screen .

During this process, the system only checks the fields of the sub screen that is actually displayed.

If you want the application program to process scrolling in a tab strip control,
All of the tab pages must share a common sub screen area
All of the tab titles must have the function code type ' ' (space), and
In the flow logic, you must use a variable to call the screen that is to be displayed in the sub screen area.


In the PAI block, you must call a module in which the function code of the active tab title is placed in the field ACTIVETAB of the structure you created in your program with type TABSTRIP. In the example above, this is MY_TAB_STRIP.

The PBO processing block must contain a module, before the sub screen is called, in which you place the number of the sub screen in the corresponding variable. In order for the screen to be processed the first time (before the user has had a chance to choose a tab title), you must assign an initial value to this field.

You can hide a tab page at run time by setting the corresponding tab title to inactive using the system table SCREEN (SCREEN-ACTIVE = '0'). You should do this before processing the tab strip control for the first time, to ensure that the screen environment remains constant.You can now create tab strip controls on selection screens. They allow you to create logical groups of fields, and make large selection screens more user-friendly.


LESSON 42 SCREEN ELEMENTS AND TABLE CONTROLS

SAP CRM Marketing Segmentation

No comments :

Post a Comment