12-26-2007 5:20 AM
Can we design a table control inside a tabstrip.I have been learning the various options,but am not able to find the exact sequence of events for writing the code.
Please send me any zcode / pdf which could solve my doubt.
12-26-2007 6:02 AM
Hi Sneha,
We can design Table control in TabStrip.
First we can design Tab Strip.
Default it has 2 Tabs.
For in Every tab u create Subscreen.
Then In the subscreen u can create Table Control.
Better u try using wizards option for this.
12-26-2007 6:02 AM
Hi Sneha,
We can design Table control in TabStrip.
First we can design Tab Strip.
Default it has 2 Tabs.
For in Every tab u create Subscreen.
Then In the subscreen u can create Table Control.
Better u try using wizards option for this.
12-26-2007 6:03 AM
Hi Sneha,
Check the Following LInks also You can get some more details
http://help.sap.com/saphelp_nw2004s/helpdata/en/04/10f2469e0811d1b4700000e8a52bed/content.htm
http://help.sap.com/saphelp_nw04/helpdata/en/6d/150d64da1011d3963800a0c94260a5/content.htm
http://sap.niraj.tripod.com/id28.html
https://www.sdn.sap.com/irj/sdn/wiki?path=/display/snippets/tabstrip%2bin%2balv(OOPS)
Kanagaraja L
12-26-2007 8:28 AM
hi shena,
I will send a sample code for creating a table control in tabstrip..check it once. i will send SE38, SE51 CODE.
SE38 CODE:
&----
*& Module pool YMODULEPOOL_TABCTRLTABSTRIP *
*& *
&----
*& DEVELOPER : KIRAN KUMAR.G *
*& PURPOSE : PLACING TABLE CONTROL IN TABSTRIPS *
*& CREATION DT : 18/12/2007 *
*& T.CODE : YMODTABCTRLTABS *
*& REQUEST : ERPK900035 *
&----
PROGRAM YMODULEPOOL_TABCTRLTABSTRIP.
----
Tables
----
tables :
yvbak, "Sales Document: Header Data
yvbap. "Sales Document: Item Data
----
Controls
----
controls: my_tab type tabstrip, "For Tabstrips
my_table type tableview using screen 110.
----
Internal Table
----
*Item Data.
data: begin of gt_item occurs 0,
vbeln like vbap-vbeln,
posnr like vbap-posnr,
matnr like vbap-matnr,
matkl like vbap-matkl,
arktx like vbap-arktx,
cflag, "Deletion Flag
end of gt_item.
*Header Data
data: begin of gt_head occurs 0,
vbeln like vbak-vbeln,
erdat like vbak-erdat,
auart like vbak-auart,
vkorg like vbak-vkorg,
vtweg like vbak-vtweg,
cflag,
end of gt_head.
----
Global Variables
----
*Table Control(MY_TABLE)
data: gv_number like sy-dynnr, "Screen Number
gv_mode type c value 'D', "C:Change D:Display
gv_temp type i, "Temporary Variable
gv_lines type i. "NO.OF Records in the Table
&----
*& Module STATUS_0100 OUTPUT
&----
text
----
module STATUS_0100 output.
SET PF-STATUS 'ZTAB'.
endmodule. " STATUS_0100 OUTPUT
&----
*& Module active_tab OUTPUT
&----
text
----
module active_tab output.
*Default Active Tab Selection.
if my_tab-activetab is initial.
my_tab-activetab = 'INFO'.
gv_number = '0110'.
endif.
endmodule. " active_tab OUTPUT
&----
*& Module copy_data1 OUTPUT
&----
text
----
module copy_data1 output.
*Read the data from the Internal Table and place them in Table control
read table gt_item index my_table-current_line.
if sy-subrc eq 0.
gt_item-vbeln = gt_item-vbeln.
gt_item-posnr = gt_item-posnr.
gt_item-matnr = gt_item-matnr.
gt_item-matkl = gt_item-matkl.
gt_item-arktx = gt_item-arktx.
endif.
endmodule. " copy_data1 OUTPUT
&----
*& Module copy_dat OUTPUT
&----
text
----
module copy_dat output.
refresh : gt_item.
select vbeln
posnr
matnr
matkl
arktx
from yvbap
into table gt_item
where vbeln = vbak-vbeln.
if sy-subrc eq 0.
describe table gt_item lines gv_lines.
my_table-lines = gv_lines + 20.
endif.
endmodule. " copy_dat OUTPUT
&----
*& Module USER_COMMAND_0100 INPUT
&----
text
----
module USER_COMMAND_0100 input.
case sy-ucomm.
when 'INFO'.
my_tab-activetab = 'INFO'.
gv_number = '0110'.
when 'EXIT' or 'CANCEL'.
call transaction 'SESSION_MANAGER'.
endcase.
endmodule. " USER_COMMAND_0100 INPUT
&----
*& Module USER_COMMAND_0110 INPUT
&----
text
----
module USER_COMMAND_0110 input.
case sy-ucomm.
*Insert New Record
when 'INSE'.
*NO.OF Recors in the Internal Table
describe table gt_item lines gv_lines.
read table gt_item index my_table-current_line.
gv_temp = gv_temp + 1.
if gv_temp gt gv_lines.
*Insert Record into Internal Table
insert table gt_item.
*Insert Record into Database Table
insert into yvbap values gt_item.
endif.
*Save the Data
when 'SAVE'.
*Modify Data in the Internal Table
modify gt_item index my_table-current_line.
if sy-subrc eq 0.
*Modify Data in the Database Table
modify yvbap from table gt_item.
endif.
*Delete the Record
when 'DELE'.
if gt_item-cflag = 'X'.
*Delete the Record from the Database Table
delete from yvbap where vbeln = gt_item-vbeln
and posnr = gt_item-posnr
and matnr = gt_item-matnr
and matkl = gt_item-matkl
and arktx = gt_item-arktx.
*Delete the Record from the Internal Table
delete gt_item index my_table-current_line.
endif.
endcase.
endmodule. " USER_COMMAND_0110 INPUT
&----
*& Module clear_data OUTPUT
&----
text
----
module clear_data output.
*Clear the data when ever u enter into Table Control
clear gv_temp.
endmodule. " clear_data OUTPUT
&----
*& Module clear_data1 OUTPUT
&----
text
----
module clear_data1 output.
clear gv_temp1.
endmodule. " clear_data1 OUTPUT
SE51 CODE(SCREEN 100)
PROCESS BEFORE OUTPUT.
MODULE STATUS_0100.
*Initial TabStrip Selection
MODULE active_tab.
*Placing Table Control data in Internal Table
module copy_dat.
*Display Mode
*calling subscreen
call subscreen subs including sy-cprog gv_number.
PROCESS AFTER INPUT.
MODULE USER_COMMAND_0100.
call subscreen subs.
SE51(SCREEN 110)
PROCESS BEFORE OUTPUT.
MODULE STATUS_0110.
loop at gt_item with control my_table cursor my_table-current_line.
module copy_data1.
endloop.
*CLEAR the Temporary variable value
module clear_data.
PROCESS AFTER INPUT.
*Populate data into internal Table
loop at gt_item.
MODULE USER_COMMAND_0110.
endloop.
Award points if helpful.
kiran kumar.G
Have a Nice Day....
12-27-2007 11:08 AM
Thanks for all the replies,I have finally been able to develop a z program for tabstrip table control.