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

Tab option in Module pool.

Former Member
0 Likes
2,232

Hey,

I want to incorporate tab functionality for my module pool programming. Can anyone tell me if there is any way I can achieve this.

-- Thanks in advance.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,414

Set cursor command for fields like

constatnts: tab_button(<Length os screen field>) type c value '<Screen field>'.

set cursor field tab_button.

4 REPLIES 4
Read only

Former Member
0 Likes
1,414

Hi,

You can use the TABSTRIP control for your requirement.

A tabstrip control is a screen element that consists of multiple tabstrip pages. Every tabstrip page contains a single-line tab title which is linked with a function code which makes it possible to access the tabstrip page with a double-click. Below the tab title, a tabstrip page consists of a subscreen area. A subscreen area must be assigned to every tab title. To do this, you have two options:

Scrolling in the SAP GUI

A tab title is assigned to each subscreen area and the function codes of the individual tab titles are defined with the function type "P". If the user selects a tab title, the event PAI is not raised. The corresponding subscreens are incorporated once into every individual subscreen area using the statement CALL SUBSCREEN of the flow logic. If the user selects a tab title, then the SAP GUI scrolls to the corresponding tabstrip page and displays its content.

Scrolling in the ABAP program

To each tab title, the same subscreen area is assigned and the function codes of the individual tab titles are defined without typing. If the user selects a tab title, then the event PAI is triggered. The corresponding subscreen is dynamically incorporated into the subscreen area CALL SUBSCREEN when scrolling using the statement CALL SUBSCREEN of the flow logic. In the ABAP program, you must activate the corresponding tabstrip title CONTROLS and the correct subscreen dynpro must be scheduled for the subscreen area.

Note

When you scroll in the SAP GUI and select a tab title, then no input checks are carried out and no data is transported to the ABAP program. The entries are not checked and the data of all subscreens is not transported until a user action takes place that triggers the event PAI. When scrolling in the ABAP program, the entries are checked at every selection of a tab title and the data of the current tabstrip page is transported to the ABAP program of the subscreen dynpro.

Regards,

Renjith Michael.

Read only

Former Member
0 Likes
1,414

hi jaspreet,

try to read help..on

http://help.sap.com/saphelp_47x200/helpdata/en/a9/8bec2390a811d1b4640000e8a52bed/content.htm

you can have my program code for check it.

coding in main screen of program.

PROCESS BEFORE OUTPUT.

MODULE status_0101.

MODULE tabstrp_active_tabstr_set.

Module set_attributes.

CALL SUBSCREEN subscreen1 INCLUDING g_tabstrp-prog g_tabstrp-subscreen.

PROCESS AFTER INPUT.

module exit_trans at exit-command.

CALL SUBSCREEN subscreen1.

MODULE tabstrp_active_tabstr_get.

MODULE user_command_0101.

coding in module pool program.

*********constant declearation****************

CONSTANTS: BEGIN OF C_TABSTRP,

TAB1 LIKE SY-UCOMM VALUE 'MAIN',

TAB2 LIKE SY-UCOMM VALUE 'DETL',

TAB3 LIKE SY-UCOMM VALUE 'HEAD',

END OF C_TABSTRP.

CONSTANTS : C_X TYPE C VALUE 'X'.

*********control declearation****************

CONTROLS : TABSTRP TYPE TABSTRIP,

TABLE_CONTROL TYPE TABLEVIEW USING SCREEN 0103.

                  • data declearation*****************

DATA : BEGIN OF G_TABSTRP,

SUBSCREEN LIKE SY-DYNNR,

PROG LIKE SY-REPID VALUE 'Z11SY_TABSTRIP_PO_PRINT',

PRESSED_TAB LIKE SY-UCOMM VALUE C_TABSTRP-TAB1,

END OF G_TABSTRP.

&----


*& Module tabstrp_active_tabstr_set OUTPUT

&----


  • text

----


MODULE TABSTRP_ACTIVE_TABSTR_SET OUTPUT.

TABSTRP-ACTIVETAB = G_TABSTRP-PRESSED_TAB.

CASE G_TABSTRP-PRESSED_TAB.

WHEN C_TABSTRP-TAB1.

G_TABSTRP-SUBSCREEN = '0102'.

CLEAR Z11SY_PO_HEADER.

WHEN C_TABSTRP-TAB2.

G_TABSTRP-SUBSCREEN = '0103'.

WHEN C_TABSTRP-TAB3.

G_TABSTRP-SUBSCREEN = '0104'.

WHEN OTHERS.

ENDCASE.

ENDMODULE. " tabstrp_active_tabstr_set OUTPUT

&----


*& Module tabstrp_active_tabstr_get INPUT

&----


  • text

----


MODULE TABSTRP_ACTIVE_TABSTR_GET INPUT.

CASE OK_CODE_0101.

WHEN C_TABSTRP-TAB1.

G_TABSTRP-PRESSED_TAB = C_TABSTRP-TAB1.

WHEN C_TABSTRP-TAB2.

G_TABSTRP-PRESSED_TAB = C_TABSTRP-TAB2.

WHEN C_TABSTRP-TAB3.

G_TABSTRP-PRESSED_TAB = C_TABSTRP-TAB3.

ENDCASE.

ENDMODULE. " tabstrp_active_tabstr_get INPUT

reward is useful,

thanks in advance..:-)

regards,

Sandeep

Read only

Former Member
0 Likes
1,414

hi,

Tabstrip with wizard is best option to create tab strip.

first go to layout of any screen.....

take element TABSTRIP with WIZARD.

then follow the steps....

1> continue

2> give name

3> than give tab text ( give different text as per need of tabs)

4> it will create subscreens automatically for that tabs... , continue

5>it will show list of includes..., continue

6> complete

here in subscreen u can create all the elements as normal screen.....

reward if usefull...

Read only

Former Member
0 Likes
1,415

Set cursor command for fields like

constatnts: tab_button(<Length os screen field>) type c value '<Screen field>'.

set cursor field tab_button.