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 controls

former_member212713
Contributor
0 Likes
854

Hello;

I have a question.

I put a table controls object in to screen.

After entering the data, when I push the save button I want to insert these data into the db table.

Could you help by giving me a simple example?

Thanks a lot.

1 ACCEPTED SOLUTION
Read only

p291102
Active Contributor
0 Likes
829

case sy-ucomm.

when 'SAVE'.

loop at itab.

<databasetable>-field1 = itab-field1.

<databasetable>-field2 = itab-field2.

................

.................

insert <databasetable>

clear itab.

endloop.

endcase.

this is the answer for ur thread

Regards,

Shankar

8 REPLIES 8
Read only

jayanthi_jayaraman
Active Contributor
Read only

0 Likes
829

This page not found (404 - The requested resource is not available.)

Read only

0 Likes
829

Hi

Please check these threads

https://forums.sdn.sap.com/click.jspa?searchID=239682&messageID=2773115

https://forums.sdn.sap.com/click.jspa?searchID=239682&messageID=2337199

I have already answered in your other thread.. please close one of them....

thanks

dominic

Read only

Former Member
0 Likes
829

this tc is defined as a internal table in ur program. so u have data in the tc and now ur pressing save...so, the data gets transferred internally to the internal table...write code as...

case sy-ucomm.

when 'SAVE'.

loop at itab.

<databasetable>-field1 = itab-field1.

<databasetable>-field2 = itab-field2.

................

.................

insert <databasetable>

clear itab.

endloop.

endcase.

Read only

p291102
Active Contributor
0 Likes
830

case sy-ucomm.

when 'SAVE'.

loop at itab.

<databasetable>-field1 = itab-field1.

<databasetable>-field2 = itab-field2.

................

.................

insert <databasetable>

clear itab.

endloop.

endcase.

this is the answer for ur thread

Regards,

Shankar

Read only

Former Member
0 Likes
829

HI,

CHECK THE BELOW CODE.

TABLES: LFA1.

Data: ITAB LIKE LFA1 OCCURS 0.

CONTROLS: TCONTROL TYPE TABLEVIEW USING SCREEN '100'.

module_-------_

case sy-ucomm.

when 'save'.

MOVE LFA1 TO ITAB.

APPEND ITAB.

INSERT INTO LFA1 VALUES ITAB..

ENDCASE.

ENDMODULE.

IF U FIND IT USEFUL MARK THE POINTS

REGARDS,

GNK

Read only

0 Likes
829

it is useful to me. thanks.