‎2009 Jan 20 7:34 AM
Hi,
im adding custom fields in mm01 and that fields should update in database..
i think for this i should go for table control in module pool.
i dnt hav any knowledge in module pool..so can u give sample code for table control (database update).
please suggest me.
thx in advance.
Neelima.
‎2009 Jan 20 7:38 AM
‎2009 Jan 20 7:44 AM
Hi,
ya i checked..in scn they provided how to create a table control..
im asking in table control how to update the database ( sample code)
Thx in advance.
Neelima.N
‎2009 Jan 20 8:20 AM
hi
i think u have to update a databasetable with the help of table control. if its so u can have a look on use the code below
if tablecontrol has fields namely id,name,branch.
create an itab that has same fields as tablecontrol and database table.
In PAI
Loop using control <tablecontrolname>
itab-id = id.
itab-name= name
itab-branch = branch
insert into <dbtable> values itab.
Endloop
in PBO.
Loop using control <tablecontrolname>
Endloop
regards
rajye
hope the content is usefull..
if the issue s resolved kindly close the thread.
‎2009 Jan 20 8:23 AM
Hi
I have a table YSTUDENT and a table control named TWRITE. I enter the data in the tbl control and it is written to the table YSTUDENT.
REPORT YJAN9_TBL_CTRL2.
*Tables: YSTUDENT.
controls: TWRITE type tableview using screen 9000.
data: itab type standard table of YSTUDENT with header line initial size 0.
data: ok_code(4),
ID like YSTUDENT-ID,
NAME like YSTUDENT-NAME,
MARK1 like YSTUDENT-MARK1.
CALL SCREEN 9000.
&----
*& Module STATUS_9000 OUTPUT
&----
text
----
MODULE STATUS_9000 OUTPUT.
SET PF-STATUS 'MENU1'.
SET TITLEBAR '900'.
ENDMODULE. " STATUS_9000 OUTPUT
&----
*& Module WRITE_TO_DB INPUT
&----
text
----
MODULE WRITE_TO_DB INPUT.
itab-ID = ID.
itab-NAME = NAME.
itab-MARK1 = MARK1.
insert into YSTUDENT values itab. * data inserted from ctrl to tbl
ENDMODULE. " WRITE_TO_DB INPUT
&----
*& Module USER_COMMAND_9000 INPUT
&----
text
----
MODULE USER_COMMAND_9000 INPUT.
ok_code = sy-ucomm.
case ok_code.
when 'BACK' or 'EXIT' or 'CANCEL'.
leave program.
when 'DON'.
Message I008(ZRAJ203).
endcase.
ENDMODULE. " USER_COMMAND_9000 INPUT
Flow Logic:
-
PROCESS BEFORE OUTPUT.
MODULE STATUS_9000.
loop with control TWRITE.
endloop.
*
PROCESS AFTER INPUT.
MODULE USER_COMMAND_9000.
loop with control TWRITE.
MODULE WRITE_TO_DB.
endloop.
Hope this helps
Regards,
Jayanthi.K
‎2009 Jan 20 9:09 AM
Hi,
Have a look at this link to get a better idea of table controls.
http://www.sapdev.co.uk/dialog/tabcontrol/tc_basic.htm
Hope this helps.
Regards,
Deepthi.
‎2009 Jan 29 11:39 AM
‎2009 Feb 19 12:50 PM
HI,
Can u please help me .
I'm doing the entries in the table control and want to update those to the database table.
What should I do.
Please help .
Regards
W. ARchana