2006 Nov 24 10:04 AM
Hi Friends,
I have created a layout in screen painter using Tabstrip with wizard which is having Tabstrip control with four tabs.
Now I want to attach to table to each tab,so that I can input some data and save in the table.
I request you to kindly guide me as to how to do the same.
TIA.
Regards,
Mark K
2006 Nov 24 10:15 AM
Hi
Insert subscreens in 4 tabs and give names to those subscreens, and create these 4 screens and change the attributes of these screens to subscreen, and call them in main screen like this.
process before output.
MODULE STATUS_1000.
*
call subscreen: <subscreen area1> including sy-repid s_no, -> <b>Screen no variable</b>
<subscreen area2> including sy-repid s_no,
process after input.
module user_command_1000.
call subscreen : <subscreen area1>,<subscreen area2>.
In the main screen code the program somewhat like this.
&----
*& Module pool ZHTABSTRIP_CONTROL *
*& *
&----
*& *
*& *
&----
program zhtabstrip_control .
tables : lfa1,kna1,mara,vbak.
data : begin of itab occurs 0,
lifnr like lfa1-lifnr,
name1 like lfa1-name1,
kunnr like kna1-kunnr,
land1 like kna1-land1,
matnr like mara-matnr,
ersda like mara-ersda,
ernam like mara-ernam,
vbeln like vbak-vbeln,
erdat like vbak-erdat,
erzet like vbak-erzet,
end of itab.
controls : tabstrip type tabstrip.
data: s_no like sy-dynnr value 100. -> <b>screen no which u r calling for the subscreen.</b>
&----
*& Module USER_COMMAND_1000 INPUT
&----
text
----
module user_command_1000 input.
case sy-ucomm.
when 'VEND'.
s_no = 100.
tabstrip-activetab = 'VEND'.
when 'CUST'.
s_no = 200.
tabstrip-activetab = 'CUST'.
when 'MAT'.
s_no = 300.
tabstrip-activetab = 'MAT'.
when 'SD'.
s_no = 400.
tabstrip-activetab = 'SD'.
when 'EXIT'.
leave program.
endcase.
endmodule. " USER_COMMAND_1000 INPUT
&----
*& Module STATUS_0100 OUTPUT
&----
text
----
module status_0100 output.
SET PF-STATUS 'xxxxxxxx'.
SET TITLEBAR 'xxx'.
select * from lfa1 into corresponding fields of table itab.
read table itab index 3.
lfa1-lifnr = itab-lifnr.
lfa1-name1 = itab-name1.
refresh itab.
endmodule. " STATUS_0100 OUTPUT
&----
*& Module STATUS_0200 OUTPUT
&----
text
----
module status_0200 output.
SET PF-STATUS 'xxxxxxxx'.
SET TITLEBAR 'xxx'.
refresh itab.
select * from kna1 into corresponding fields of table itab.
read table itab index 1.
kna1-kunnr = itab-kunnr.
kna1-land1 = itab-land1.
endmodule. " STATUS_0200 OUTPUT
&----
*& Module STATUS_0300 OUTPUT
&----
text
----
module status_0300 output.
SET PF-STATUS 'xxxxxxxx'.
SET TITLEBAR 'xxx'.
refresh itab.
select * from mara into corresponding fields of table itab.
read table itab index 5.
mara-matnr = itab-matnr.
mara-ersda = itab-ersda.
mara-ernam = itab-ernam.
endmodule. " STATUS_0300 OUTPUT
&----
*& Module STATUS_0400 OUTPUT
&----
text
----
module status_0400 output.
SET PF-STATUS 'xxxxxxxx'.
SET TITLEBAR 'xxx'.
refresh itab.
select * from vbak into corresponding fields of table itab.
read table itab index 7.
vbak-vbeln = itab-vbeln.
vbak-erdat = itab-erdat.
vbak-erzet = itab-erzet.
endmodule.
Hope this code will give you some idea.
Regards
Haritha.
Hi
Insert subscreens in 4 tabs and give names to those subscreens, and create these 4 screens and change the attributes of these screens to subscreen, and call them in main screen like this.
process before output.
MODULE STATUS_1000.
*
call subscreen: <subscreen area1> including sy-repid s_no, -> <b>Screen no variable</b>
<subscreen area2> including sy-repid s_no,
process after input.
module user_command_1000.
call subscreen : <subscreen area1>,<subscreen area2>.
In the main screen code the program somewhat like this.
&----
*& Module pool ZHTABSTRIP_CONTROL *
*& *
&----
*& *
*& *
&----
program zhtabstrip_control .
tables : lfa1,kna1,mara,vbak.
data : begin of itab occurs 0,
lifnr like lfa1-lifnr,
name1 like lfa1-name1,
kunnr like kna1-kunnr,
land1 like kna1-land1,
matnr like mara-matnr,
ersda like mara-ersda,
ernam like mara-ernam,
vbeln like vbak-vbeln,
erdat like vbak-erdat,
erzet like vbak-erzet,
end of itab.
controls : tabstrip type tabstrip.
data: s_no like sy-dynnr value 100. -> <b>screen no which u r calling for the subscreen.</b>
&----
*& Module USER_COMMAND_1000 INPUT
&----
text
----
module user_command_1000 input.
case sy-ucomm.
when 'VEND'.
s_no = 100.
tabstrip-activetab = 'VEND'.
when 'CUST'.
s_no = 200.
tabstrip-activetab = 'CUST'.
when 'MAT'.
s_no = 300.
tabstrip-activetab = 'MAT'.
when 'SD'.
s_no = 400.
tabstrip-activetab = 'SD'.
when 'EXIT'.
leave program.
endcase.
endmodule. " USER_COMMAND_1000 INPUT
&----
*& Module STATUS_0100 OUTPUT
&----
text
----
module status_0100 output.
SET PF-STATUS 'xxxxxxxx'.
SET TITLEBAR 'xxx'.
select * from lfa1 into corresponding fields of table itab.
read table itab index 3.
lfa1-lifnr = itab-lifnr.
lfa1-name1 = itab-name1.
refresh itab.
endmodule. " STATUS_0100 OUTPUT
&----
*& Module STATUS_0200 OUTPUT
&----
text
----
module status_0200 output.
SET PF-STATUS 'xxxxxxxx'.
SET TITLEBAR 'xxx'.
refresh itab.
select * from kna1 into corresponding fields of table itab.
read table itab index 1.
kna1-kunnr = itab-kunnr.
kna1-land1 = itab-land1.
endmodule. " STATUS_0200 OUTPUT
&----
*& Module STATUS_0300 OUTPUT
&----
text
----
module status_0300 output.
SET PF-STATUS 'xxxxxxxx'.
SET TITLEBAR 'xxx'.
refresh itab.
select * from mara into corresponding fields of table itab.
read table itab index 5.
mara-matnr = itab-matnr.
mara-ersda = itab-ersda.
mara-ernam = itab-ernam.
endmodule. " STATUS_0300 OUTPUT
&----
*& Module STATUS_0400 OUTPUT
&----
text
----
module status_0400 output.
SET PF-STATUS 'xxxxxxxx'.
SET TITLEBAR 'xxx'.
refresh itab.
select * from vbak into corresponding fields of table itab.
read table itab index 7.
vbak-vbeln = itab-vbeln.
vbak-erdat = itab-erdat.
vbak-erzet = itab-erzet.
endmodule.
Hope this code will give you some idea.
Regards
Haritha.
2006 Nov 24 10:08 AM
Create subscreen for each tab and individually u need to handle each subscreen as a single screen.
Regards
- Gopi
2006 Nov 24 10:09 AM
Place a sub screen on each tab and you can handle the sub screen the way you handle the normal screen. You can place a table control on each of the screens and write the PBO and PAI for the screens.
Regards,
Ravi
Note - Please mark all the helpful answers
2006 Nov 24 10:11 AM
2006 Nov 24 10:13 AM
Open the tab strip and drag and drop the SUB SCREEN element from the screen elements you have on the left handside, on the screen painter.
Now, create a screen for the program and mark that as subscreen in the attributes and call that subscreen when hit the appropriate TAB
see program DEMO_DYNPRO_SUBSCREENS for example.
Regards,
Ravi
Note - Please mark all the helpful answers
2006 Nov 24 10:15 AM
Hi
It's just as to create a screen, only you've to set the flag SUBSCREEN as dynpro type in the chararcteristics in screen painter.
Max
2006 Nov 24 10:20 AM
Check these programs for better understanding of tab strips.
demo_dynpro_tabstrip_local
demo_dynpro_tabstrip_server
Regards
- Gopi
2006 Nov 24 10:14 AM
please follow this link its really useful.
<a href="http://help.sap.com/saphelp_erp2005vp/helpdata/en/9f/dbab6235c111d1829f0000e829fbfe/frameset.htm">http://help.sap.com/saphelp_erp2005vp/helpdata/en/9f/dbab6235c111d1829f0000e829fbfe/frameset.htm</a>
reward useful answers,
Regards,
Shrita Sharma
2006 Nov 24 10:15 AM
Hi
Insert subscreens in 4 tabs and give names to those subscreens, and create these 4 screens and change the attributes of these screens to subscreen, and call them in main screen like this.
process before output.
MODULE STATUS_1000.
*
call subscreen: <subscreen area1> including sy-repid s_no, -> <b>Screen no variable</b>
<subscreen area2> including sy-repid s_no,
process after input.
module user_command_1000.
call subscreen : <subscreen area1>,<subscreen area2>.
In the main screen code the program somewhat like this.
&----
*& Module pool ZHTABSTRIP_CONTROL *
*& *
&----
*& *
*& *
&----
program zhtabstrip_control .
tables : lfa1,kna1,mara,vbak.
data : begin of itab occurs 0,
lifnr like lfa1-lifnr,
name1 like lfa1-name1,
kunnr like kna1-kunnr,
land1 like kna1-land1,
matnr like mara-matnr,
ersda like mara-ersda,
ernam like mara-ernam,
vbeln like vbak-vbeln,
erdat like vbak-erdat,
erzet like vbak-erzet,
end of itab.
controls : tabstrip type tabstrip.
data: s_no like sy-dynnr value 100. -> <b>screen no which u r calling for the subscreen.</b>
&----
*& Module USER_COMMAND_1000 INPUT
&----
text
----
module user_command_1000 input.
case sy-ucomm.
when 'VEND'.
s_no = 100.
tabstrip-activetab = 'VEND'.
when 'CUST'.
s_no = 200.
tabstrip-activetab = 'CUST'.
when 'MAT'.
s_no = 300.
tabstrip-activetab = 'MAT'.
when 'SD'.
s_no = 400.
tabstrip-activetab = 'SD'.
when 'EXIT'.
leave program.
endcase.
endmodule. " USER_COMMAND_1000 INPUT
&----
*& Module STATUS_0100 OUTPUT
&----
text
----
module status_0100 output.
SET PF-STATUS 'xxxxxxxx'.
SET TITLEBAR 'xxx'.
select * from lfa1 into corresponding fields of table itab.
read table itab index 3.
lfa1-lifnr = itab-lifnr.
lfa1-name1 = itab-name1.
refresh itab.
endmodule. " STATUS_0100 OUTPUT
&----
*& Module STATUS_0200 OUTPUT
&----
text
----
module status_0200 output.
SET PF-STATUS 'xxxxxxxx'.
SET TITLEBAR 'xxx'.
refresh itab.
select * from kna1 into corresponding fields of table itab.
read table itab index 1.
kna1-kunnr = itab-kunnr.
kna1-land1 = itab-land1.
endmodule. " STATUS_0200 OUTPUT
&----
*& Module STATUS_0300 OUTPUT
&----
text
----
module status_0300 output.
SET PF-STATUS 'xxxxxxxx'.
SET TITLEBAR 'xxx'.
refresh itab.
select * from mara into corresponding fields of table itab.
read table itab index 5.
mara-matnr = itab-matnr.
mara-ersda = itab-ersda.
mara-ernam = itab-ernam.
endmodule. " STATUS_0300 OUTPUT
&----
*& Module STATUS_0400 OUTPUT
&----
text
----
module status_0400 output.
SET PF-STATUS 'xxxxxxxx'.
SET TITLEBAR 'xxx'.
refresh itab.
select * from vbak into corresponding fields of table itab.
read table itab index 7.
vbak-vbeln = itab-vbeln.
vbak-erdat = itab-erdat.
vbak-erzet = itab-erzet.
endmodule.
Hope this code will give you some idea.
Regards
Haritha.
2006 Nov 24 11:38 AM
Hi Haritha,
I have created the 4 different subscreens.
I would like to know as to when I click the Tab1, how to get the subscreen1.
Kindly guide me.
Regards,
2006 Nov 24 11:42 AM
HI,
When you click a TAB that tabs FCODE will be there in the ACTIVETAB filed of the tabstrip structure.
Then use the statement CALL SUBSCREEN <sub_area> including <program_name> <screen_number>. in PBO and
CALL SUBSCREEN <sub_area> in PAI.
Regards,
Sesh
2006 Nov 24 11:46 AM
Hi Mark,
Let me start from Scratch,
1. in PBO of screen painter,
CALL SUBSCREEN <subscreen area name> including <Module-pool programname> <Screen no.>.
2. In PAI (SE38).
CASE OK_CODE.
When 'TAB1'.
TAB-ACTIVETAB = 'TAB1'.
ENDCASE.
TAB1 Is the Function code which you would have given during design of tabstrip.
TAB is the Tabstrip name, infact it should be defined in SE38 as
CONTROLS TAB TYPE TABSTRIP. In declaration.
Hope this solves your issue.
Cheers...
Santosh.
PS: Mark All Usefull Answers.
2006 Nov 24 10:17 AM
Hi
There is an icon in the screen painter after box icon, drag that and paste it in each tab.
Regards
Haritha.
2006 Nov 24 11:43 AM
Hi
See the code which is highlighted.
controls : tabstrip type tabstrip.
data: s_no like sy-dynnr value 100. -> screen no which u r calling for the subscreen.
&----
*& Module USER_COMMAND_1000 INPUT
&----
text
----
module user_command_1000 input.
case sy-ucomm.
when 'VEND'.
<b>s_no = 100. -> You are calling the subscreen 100
tabstrip-activetab = 'VEND'. -> You r activating the vendor tab </b>
when 'CUST'.
<b>s_no = 200. -> You are calling the subscreen 200
tabstrip-activetab = 'CUST'. -> You r activating the vendor tab </b>
when 'MAT'.
<b>s_no = 300.
tabstrip-activetab = 'MAT'.</b>
when 'SD'.
<b>s_no = 400.
tabstrip-activetab = 'SD'.</b>
when 'EXIT'.
leave program.
endcase.
endmodule. " USER_COMMAND_1000 INPUT
Regards
Haritha
Message was edited by:
Haritha Ramayanam
2006 Nov 24 11:50 AM
Hi Haritha,
What is 'VEND', 'CUST' and 'MAT'. These indicate which names and from where will I get these details.
Pls.
Regards,
2006 Nov 27 2:39 AM
hi,
Those are the Names of Tabs in Tabstrip.
Cheers...
Santosh
| User | Count |
|---|---|
| 3 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |