Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Table control (database update)

Former Member
0 Likes
943

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.

7 REPLIES 7
Read only

Former Member
0 Likes
865

Hi Neelima,

did you checkd in SCN before posting.

refer to this link

Regards!!

Read only

0 Likes
865

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

Read only

0 Likes
865

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.

Read only

Former Member
0 Likes
865

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

Read only

Former Member
0 Likes
865

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.

Read only

Former Member
0 Likes
865

.

solved myself.thank u all.

Read only

0 Likes
865

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