11-16-2007 6:41 AM
hi,
how to insert multiple records at atime to database table from tablecontrol.
11-16-2007 6:44 AM
Hi
fetch the data from table control into an internal table and then insert into database table using INSERT/MODIFY command.
check the links
Check the below links.
just refer to the link below
http://www.sapmaterial.com/tablecontrol_sap.html
step by step procedure with screen shots
http://www.planetsap.com/howdo_a.htm
http://help.sap.com/saphelp_nw2004s/helpdata/en/9f/dbac5135c111d1829f0000e829fbfe/content.htm
http://sap.niraj.tripod.com/id25.html
Also you can see the below examples...
Go to se38 and give demodynpro and press F4.
YOu will get a list of demo module pool programs.
One more T-Code is ABAPDOCU.
YOu can find more examples there.
See the prgrams:
DEMO_DYNPRO_TABLE_CONTROL_1 Table Control with LOOP Statement
DEMO_DYNPRO_TABLE_CONTROL_2 Table Control with LOOP AT ITAB
http://www.geocities.com/ZSAPcHAT
http://www.allsaplinks.com/files/using_table_in_screen.pdf
Regards
Anji
Message was edited by:
Anji Reddy Vangala
11-16-2007 6:56 AM
Actually it is not neccesary to use table control to insert multiple records into database table try to use table maintanence generator
go to se11 enter the table in which u want to insert multiple records go to utilities and go for table maintenance generator by which u can enter multiple entries
11-16-2007 8:51 AM
Hi Narsimha,
in order to pass data from table control to program do this :
Declare an internal table with the same structuire as table control with header line.
also in thew attributes of table control mark <b>w/selcolumn</b> and give some name say-mark.
Now in the top include declare this field
data mark type c.
Make sure you give the same name to fields of table control as that of internal table fields so that data transfer is automatic.
suppose u have a field NAME age profession in table control.
do this.
************************************************************************
top include.
types : begin of struct,
name(20) type c,
age type i,
profession(30) type c,
end of struct.
data itab_tabcon type standard table of struct with header line.
data mark type c.
*****************************************************
now name your table control fields as
itab_tabcon-name
itab_tabcon-age
itab_tabcon-profession.
in flow logic of screen make your pai dependent on mark
PROCESS BEFORE OUTPUT.
MODULE STATUS_9001.
LOOP AT ITAB_TABCON WITH CONTROL TABCON.
ENDLOOP.
PROCESS AFTER INPUT.
LOOP AT ITAB_TABCON.
<b>FIELD MARK</b>
MODULE USER_COMMAND_9001 <b>ON REQUEST</b>.
ENDLOOP.
in pai module (USER_COMMAND_9001 ).
append itab_tabcon."append rows to internal table
clear itab_tabcon. "work area.
with this whenever u select the rows of table control in screen(while execution)then this module is invoked.
so the rows which are selected will be appended to itab_tabcon.
hope this helps you.
please reward points if useful.