‎2008 Mar 03 6:07 AM
Hai Gurs,
I have to keep table-control in Tab-strip is it possible .I tried fot that its now coming ..if it possible can you say the details how to create that .
" I need a Table-control on the Tab-strip ".
‎2008 Mar 03 9:20 AM
hi,
here i have two tabs, so two subscreen. in Subscreen 0020(sub2) i am creating a table control.
This is for screen 0002(tab strip screen):
PROCESS BEFORE OUTPUT.
MODULE status_0002.
CALL SUBSCREEN sub2 INCLUDING 'SAPMZTABLECONTROL' '0020'.
CALL SUBSCREEN sub1 INCLUDING 'SAPMZTABLECONTROL' '0010'.
PROCESS AFTER INPUT.
MODULE user_command_0002.
CALL SUBSCREEN sub1.
CALL SUBSCREEN sub2.
For Subscreen 0020(create table control here):
PROCESS BEFORE OUTPUT.
MODULE STATUS_0020.
loop at wi_zacc_master2 cursor cur1 with control tb2.
endloop.(dont forget to write this stmt)
PROCESS AFTER INPUT.
MODULE USER_COMMAND_0020.
loop at wi_zacc_master2.
endloop.
(wi_zacc_master2 is the internal table.)
in the top include write,
controls tb2 type tableview using screen 0020.
here,
tb2 is the table control name.
(just now tried it, its working)
Hope this helps u,
Regards,
Arunsri
‎2008 Mar 03 9:24 AM
Hi,
CREATING TABSTRIPS IN MPP:
-
In a normal screen, we can add only maximum of 40 components.
To make a screen hold more than 40 components, we can use tabstrip controls.
NAVIGATIONS TO CREATE TABSTRIP CONTROL:
-
1. Create an MPP program.
2. Create a normal screen (100)
-> Add Tabstrip Control component from toolbar
-> By default, a tabstrip control is created with 2 tab buttons
-> Double click on tabstrip control
-> Specify name (TBSTR) in Attributes box
-> Click on First tab button
-> Add Subscreen Area from toolbar to first tab button
-> Double click on subscreen area
-> Specify name (SUB1)
-> Click on Second tab button
-> Repeat same process for adding subscreen area (SUB2)
-> Double click on First tab button
-> Specify attributes (TAB1,FIRST,TAB1)
-> Double click on Second tab button
-> Specify attributes (TAB2, SECOND, TAB2)
-> SAve
-> Flowlogic.
3. Create two subscreens (10, 20) -> Add required components in each subscreen.
4. In Top Include File, specify following code:
DATA : IO1(10), IO2(10), IO3(10), IO4(10).
CONTROLS TBSTR TYPE TABSTRIP.
DATA A LIKE SY-DYNNR.
'CONTROLS' statement is used to allocate a memory area for the tabstrip created in the normal screen. 'TABSTRIP' itself is a data type for the tabstrip control. Whenever a tabstrip is created, SAP creates an object called 'ACTIVETAB' which is used to call the corresponding subscreens for each tab button in PAI.
5. In Flowlogic editor, write following code to initiate the subscreens to the corresponding subscreen areas of each tab button when the main screen is called:
PROCESS BEFORE OUTPUT.
MODULE STATUS_0100.
CALL SUBSCREEN SUB1 INCLUDING 'SAPMZTABSTRIP' '10'.
CALL SUBSCREEN SUB2 INCLUDING 'SAPMZTABSTRIP' '20'.
PROCESS AFTER INPUT.
MODULE USER_COMMAND_0100.
CALL SUBSCREEN SUB1.
CALL SUBSCREEN SUB2.
6. In PAI, specify following code for click events on each tab button:
CASE SY-UCOMM.
WHEN 'TAB1'.
A = '10'. * calls specified subscreen during PAI
TBSTR-ACTIVETAB = 'TAB1'. * makes entire tab button in active status
WHEN 'TAB2'.
A = '20'.
TBSTR-ACTIVETAB = 'TAB2'.
WHEN 'DISPLAY'.
LEAVE TO LIST-PROCESSING.
WRITE 😕 IO1, IO2, IO3, IO4.
WHEN 'EXIT'.
LEAVE PROGRAM.
ENDCASE.
7. Create a Tcode -> Activate all -> Execute.
Regards,
Priya.
‎2008 Mar 05 10:43 AM
Hi,
The problem is : tabs are called as exit commands => the PAI of the subscreen is not called when you switch to the other tab.
The solution is to manage the switch in a module after the subscreens :
PROCESS AFTER INPUT.
MODULE USER_COMMAND_0100.
CALL SUBSCREEN SUB1.
CALL SUBSCREEN SUB2.
MODULE PROCESS_FCODE_0100.
Where the PROCESS_FCODE_0100 is :
CASE OKCODE.
WHEN 'TAB1'.
A = '10'. * calls specified subscreen during PAI
TBSTR-ACTIVETAB = 'TAB1'. * makes entire tab button in active status
WHEN 'TAB2'.
A = '20'.
TBSTR-ACTIVETAB = 'TAB2'.
ENDCASE.
And the USER_COMMAND_0100 is :
CASE SY-UCOM.
WHEN 'EXIT'.
LEAVE PROGRAM.
ENDCASE.
‎2010 May 03 10:42 AM