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

Module pool programming

Former Member
0 Likes
621

Hi to all,

Can any one give a example how to create TABSTRIPS and how to create the ICONS

3 REPLIES 3
Read only

Former Member
0 Likes
553

Icon you can create using PF status

SET PF-STATUS 'STANDARD1' EXCLUDING rt_extab.

If you want there are standard ones which you can copy for example for alv

you can copy from se80->function group (SALV)

in it standard under GUIstatus. you can copy to ur program.

Tab strips:

REPORT ZTABSTRIP.

SELECTION-SCREEN BEGIN OF SCREEN 1100 AS SUBSCREEN NO INTERVALS.

SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE text-010.

PARAMETERS: p1(10) TYPE c,

p2(10) TYPE c,

p3(10) TYPE c.

SELECTION-SCREEN END OF BLOCK b1.

SELECTION-SCREEN END OF SCREEN 1100.

SELECTION-SCREEN BEGIN OF SCREEN 1200 AS SUBSCREEN NO INTERVALS.

SELECTION-SCREEN BEGIN OF BLOCK b2 WITH FRAME TITLE text-020.

PARAMETERS: q1(10) TYPE c OBLIGATORY,

q2(10) TYPE c OBLIGATORY,

q3(10) TYPE c OBLIGATORY.

SELECTION-SCREEN END OF BLOCK b2.

SELECTION-SCREEN END OF SCREEN 1200.

CONTROLS mytabstrip TYPE TABSTRIP.

DATA: ok_code TYPE sy-ucomm,

save_ok TYPE sy-ucomm.

DATA: number(4) TYPE n VALUE '1100'.

START-OF-SELECTION.

mytabstrip-activetab = 'BUTTON1'.

CALL SCREEN 100.

MODULE status_0100 OUTPUT.

SET PF-STATUS 'SCREEN_100'.

ENDMODULE.

MODULE cancel INPUT.

LEAVE PROGRAM.

ENDMODULE.

Read only

Former Member
0 Likes
553

Hi,

<u><b>Tabstrip Controls</b></u>

A tabstrip control is a screen object consisting of two or more pages. Each tab page consists of a tab title and a page area. If the area occupied by the tabstrip control is too narrow to display all of the tab titles, a scrollbar appears, allowing you to reach the titles that are not displayed. There is also a pushbutton that allows you to display a list of all tab titles.

Tabstrip controls allow you to place a series of screens belonging to an application on a single screen, and to navigate between them easily. The recommended uses and ergonomic considerations for tabstrip controls are described in the Tabstrip Control section of the SAP Style Guide.

From a technical point of view, a tab page is a subscreen with a pushbutton assigned to it, which is displayed as the tab title.

The tabstrip control is the set of all the tab pages. Tabstrip controls are therefore subject to the same restrictions as subscreens. In particular, you cannot change the GUI status when you switch between pages in the tabstrip control. However, they are fully integrated into the screen environment, so present no problems with batch input.

To use a tabstrip control on a screen, you must be using a SAPgui with Release 4.0 or higher, and its operating system must be Motif, Windows 95, MacOS, or Windows NT with version 3.51 or higher.

When you create a tabstrip control, you must:

1. Define the tab area on a screen and the tab titles.

2. Assign a subscreen area to each tab title.

3. Program the screen flow logic.

4. Program the ABAP processing logic.

You must then decide whether you want to page through the tabstrip control at the SAPgui or on the application server. In the first case, each tab page has its own subscreen. In the second, there is a single subscreen area that is shared by all tab pages.

<u><b>Defining the Tabstrip Control Area and Tab Titles</b></u>

You define both the tabstrip area and the tab titles in the screen layout.

The tabstrip area has a unique name and a position, length, and height. You can also specify whether the tabstrip area can be resized vertically or horizontally when the user resizes the window. If the area supports resizing, you can specify a minimum size for it. When you define a tabstrip area, it already has two tab titles. Tab titles are technically exactly the same as pushbuttons. To create additional tab titles, simple create pushbuttons in the row containing the tab titles. Tab titles have the same attributes as pushbuttons, that is, each has a name, a text, and a function code. You can also use icons and dynamic texts with tab titles.

<b>Assigning a Subscreen Area to a Tab Title</b>

You must assign a subscreen area to each tab title. There are two ways of doing this:

<b>Paging in the SAPgui</b>

You need to assign a separate subscreen area to each tab title, and define the function codes of the tab titles with type P (local GUI function). In the screen flow logic, you call all the subscreens in the PBO event. This means that all of the tab pages reside locally on the SAPgui. When the user chooses a tab title, paging takes place within the SAPgui. In this respect, the tabstrip control behaves like a single screen. In particular, the PAI event is not triggered when the user chooses a tab title, and no data is transported. While this improves the performance of

your tabstrip control, it also has the negative effect that when the user does trigger the PAI event, all of the input checks for all of the subscreens are performed. This means that when the user is working on one tab page, the input checks may jump to an unfilled mandatory field on another page.

Local paging at the SAPgui is therefore most appropriate for screens that display data rather than for input screens.

<b>Paging on the Application Server</b>

One subscreen area is shared by all tab titles and called in the PBO event. You define the function codes of the individual tab titles without a special function type. When the user chooses a tab page, the PAI event is triggered, and you must include a module in your flow logic that activates the appropriate tab page and assigns the correct subscreen to the subscreen area. Since the PAI event is triggered each time the user chooses a tab title, this method is less economical for the application server, but the input checks that are performed only

affect the current tab page.

<b>Procedure in Either Case</b>

You create the subscreen areas within the tabstrip area. You assign the subscreen areas to one or more tab titles in the Screen Painter by selecting one or more titles. You can also assign a subscreen area to a tab title in the tab title attributes by entering the name of the subscreen area in the Reference field attribute. The procedure for the alphanumeric Screen Painter is described under Creating Tabstrip Controls.

If you are paging at the SAPgui, create a subscreen area for each tab title. If you are paging at the application server, select all tab titles and create a single subscreen area. The subscreen areas may not cover the top line of the tab area. However, within a tab area, more than one subscreen area can overlap.

<b>Programming the Flow Logic</b>

In the flow logic, all you have to do by hand is include the correct subscreens. The

screen flow and data transport to the ABAP program is the same as for normal subscreens.

There are two ways of programming the screen flow logic, depending on how you have decided to page through the tabstrip control.

<b>Paging in the SAPgui</b>

When you page in the SAPgui, you must include a subscreen for each subscreen area:

PROCESS BEFORE OUTPUT.

...

CALL SUBSCREEN: <area1> INCLUDING [<prog1>] <dynp1>,

<area2> INCLUDING [<prog2>] <dynp2>,

<area3> INCLUDING [<prog3>] <dynp3>,

...

...

PROCESS AFTER INPUT.

...

CALL SUBSCREEN: <area1>,

<area2>,

<area3>,

...

...

<b>Paging on the Application Server</b>

When you page on the application server, you only have to include a subscreen for the one

subscreen area:

PROCESS BEFORE OUTPUT.

...

CALL SUBSCREEN <area> INCLUDING [<prog>] <dynp>.

...

PROCESS AFTER INPUT.

...

CALL SUBSCREEN <area>.

...

<b>Handling in the ABAP Program</b>

Before you can use a tabstrip control in your ABAP program, you must create a control for each control in the declaration part of your program using the following statement:

CONTROLS <ctrl> TYPE TABSTRIP.

where <ctrl> is the name of the tabstrip area on a screen in the ABAP program. The control allows the ABAP program to work with the tabstrip control. The statement declares a structure with the name <ctrl> . The only component of this structure that you need in your program is called ACTIVETAB.

Use in the PBO event

Before the screen is displayed, you use the control to set the tab page that is currently active. To do this, assign the function code of the corresponding tab title to the component ACTIVETAB:

<ctrl>-ACTIVETAB = <fcode>.

When you page at the SAPgui, you only need to do this once before the screen is

displayed. This initializes the tabstrip control. The default active tab page is the first page. After this, the page activated when the user chooses a tab title is set within SAPgui.

When you page on the application server, you must assign the active page both before the screen is displayed for the first time, and each time the user pages. At the same time, you must set the required subscreen screen.

You can suppress a tab page dynamically by setting the ACTIVE field of table SCREEN to 0 for the corresponding tab title.

Use in the PAI event

In the PAI event, ACTIVETAB contains the function code of the last active tab title on the screen. When you page in the SAPgui, this allows you to find out the page that the user can currently see. When you page at the application server, the active tab page is controlled by the ABAP program anyway.

The OK_CODE field behaves differently according to the paging method:

Paging in the SAPgui

When you page in the SAPgui, the PAI event is not triggered when the user chooses a tab title, and the OK_CODE field is not filled. The OK_CODE field is only filled by user actions in the GUI status or when the user chooses a pushbutton either outside the tabstrip control or on one of the subscreens.

Paging on the application server

If you are paging at the application server, the PAI event is triggered when the user

chooses a tab title, and the OK_CODE field is filled with the corresponding function code.

To page through the tabstrip control, you must assign the function code to the

ACTIVETAB component of the control:

<ctrl>-ACTIVETAB = <ok_code>.

This statement overwrites the function code of the last active tab page with that of the new tab title. At the same time, you must ensure that the correct subscreen is inserted in the subscreen area.

Otherwise, tabstrip controls are handled like normal subscrens in ABAP programs, that is, the ABAP program of a subscreen screen must contain the dialog modules called from the flow logic of the subscreen.

Examples

Tabstrip control, paging at SAPgui

REPORT DEMO_DYNPRO_TABSTRIP_LOCAL.

CONTROLS MYTABSTRIP TYPE TABSTRIP.

DATA: OK_CODE TYPE SY-UCOMM,

SAVE_OK TYPE SY-UCOMM.

MYTABSTRIP-ACTIVETAB = 'PUSH2'.

CALL SCREEN 100.

MODULE STATUS_0100 OUTPUT.

SET PF-STATUS 'SCREEN_100'.

ENDMODULE.

MODULE CANCEL INPUT.

LEAVE PROGRAM.

ENDMODULE.

MODULE USER_COMMAND INPUT.

SAVE_OK = OK_CODE.

CLEAR OK_CODE.

IF SAVE_OK = 'OK'.

MESSAGE I888(SABAPDOCU) WITH 'MYTABSTRIP-ACTIVETAB ='

MYTABSTRIP-ACTIVETAB.

ENDIF.

ENDMODULE.

The screen flow logic for screen 100 is as follows:

PROCESS BEFORE OUTPUT.

MODULE STATUS_0100.

CALL SUBSCREEN: SUB1 INCLUDING SY-REPID '0110',

SUB2 INCLUDING SY-REPID '0120',

SUB3 INCLUDING SY-REPID '0130'.

PROCESS AFTER INPUT.

MODULE CANCEL AT EXIT-COMMAND.

CALL SUBSCREEN: SUB1,

SUB2,

SUB3.

MODULE USER_COMMAND.

Regards,

Bhaskar

Read only

Former Member
0 Likes
553

hi,

for tabstrip,

At the time of designing screen, take the tabstrip control on it.

And name it,

take the subscreen on each of the tabstrip page,

In PBO and PAI write the coding for calling the screen into the subscreen of the tabstrip page.

thanks

Dharmishta