2008 Sep 04 11:39 AM
Frenz,
I have created one internal table and i am doing loop on it like...
Loop at it_data into wa_data.
-----
-----
-----
Endloop.
I want to insert some data into table zdata.
How to use INSERT records on this data base table?
Give me one example.
Regards,
RH
2008 Sep 04 11:43 AM
Hi,
Use the following statement for inserting the records
however the data is there in the internal table it_data.
modify zdata from table it_data.
it_data must consists of all the fields of the table zdata and importantly primary keys of the table zdata.
Hi,
Use the following statement for inserting the records
however the data is there in the internal table it_data.
modify zdata from table it_data.
it_data must consists of all the fields of the table zdata and importantly primary keys of the table zdata.
2008 Sep 04 11:43 AM
Hi,
Use the following statement for inserting the records
however the data is there in the internal table it_data.
modify zdata from table it_data.
it_data must consists of all the fields of the table zdata and importantly primary keys of the table zdata.
2008 Sep 04 11:44 AM
Hello
INSERT zdata FROM TABLE it_data.
Loop/endloop - here not it is necessary.
2008 Sep 04 11:45 AM
Hi,
explain better what you want....
Do you want to change data in an existing raw?
Loop at tb_data into wa_data.
wa_data-field1 = 'jsahdu'.
modify tb_data from wa_data.
endloop.
If you want to add raws you use APPEND statement.
In the end you'll modify your table zdata from the internal table tb_data:
MODIFY zdata FROM TABLE tb_data.
Using modify you change raws basing on primary keys. If a raw doesn't exist it will be inserted.
Regards
2008 Sep 04 11:45 AM
Hi Dude,
INSERT INTO ZDATA VALUES wa_data.
or
Insert FROM TABLE itab .
Regards,
Ramki
2008 Sep 04 11:45 AM
Hi ronny,
Checkl these links;-
http://www.sapdb.org/7.4/htmhelp/34/ee7fb7293911d3a97d00a0c9449261/content.htm
http://help.sap.com/saphelp_nw04/helpdata/en/c4/93d942f7ca45b69dfdfd424c38332e/content.htm
Best of luck,
Bhumika
2008 Sep 04 11:46 AM
Hi
Do in this way.
Loop at it_data into wa_data.
-----
-----
-----
INSERT INTO ZDATA VALUES WA_DATA.
Endloop.
2008 Sep 04 11:46 AM
2008 Sep 04 11:46 AM
hi,
check this sample code.
Loop at it_data into wa_data.
insert zgm_table from table it_data.
Endloop.
IF sy-subrc = 0.
MESSAGE 'records created succesfully' TYPE 'S'.
ENDIF.
2008 Sep 04 11:46 AM
Hi,
Use your code like this.
Loop at it_data into wa_data.
ztable-field1 = wa_data-field1.
ztable-field2 = wa_data-field2.
-
-
modify ztable.
Endloop.
Otherwise you can also use the Update statement.
Regards,
Amit Kumar Singh
2008 Sep 04 11:46 AM
use:
Loop at it_data into wa_data.
INSERT INTO zdata VALUES wa_data.
Endloop.
2008 Sep 04 11:51 AM
Hi,
Plz try this way :
loop at it_data into wa_data.
INSERT INTO databasetable VALUES wa_data.
endloop.
but it always good to use MODIFY statement as it handles a new row insert as well as update existing row.
thanx.
2008 Sep 04 11:56 AM
hi,
write Insert in ur abap editor, place the cursor on it and press F1.
U will get all the details.
Anyhow, in this case-
Insert into <tablename> values <workarea name>.
Hope this helps u.
Regards,
Aleem.
2008 Sep 10 3:31 PM
| User | Count |
|---|---|
| 5 | |
| 3 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |