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

Append records to datatable

Former Member
0 Likes
663

Hi ,

I created a datatable in SE11 with 4 columns and i need to update data into it using ABAP can u please help me on this.

Regards,

naveen

1 ACCEPTED SOLUTION
Read only

jayanthi_jayaraman
Active Contributor
0 Likes
604

Hi,

If you want to insert records into database table,

data : itab type standard table of ztable,

wa type ztable.

wa-f1 = 'ABC'."some valid value according to your fields

wa-f2 = 'CDE'."some valid value according to your fields

wa-f3 = 'EFG'."some valid value according to your fields

wa-f4 = 'GEH'."some valid value according to your fields

append wa to itab.

...."append similarly other records

insert ztable from table itab.

Hi ,

I created a datatable in SE11 with 4 columns and i need to update data into it using ABAP can u please help me on this.

Regards,

naveen

3 REPLIES 3
Read only

Former Member
0 Likes
604

it is standared table or ztable if it is ztable make maintinance view and upload data...

Read only

Former Member
0 Likes
604

Hi Naveen,

You can use the command INSERT <dbtab> FROM TABLE <itab> to create several rows in a database table.

The internal table <itab> that you should specify here must have the same line structure as the corresponding database table and the new data records. The client field that might exist in the internal table <itab> will only be taken into consideration if the CLIENT SPECIFIED addition is specified. If there is no CLIENT SPECIFIED addition, the current execution client applies. If it is possible to create all the lines, sy-subrc is automatically set to zero.If, however, even one data record cannot be created, a runtime error occurs. This means that the entire insertion operation is discarded (database rollback). If, in such a case, you want to have records that can be inserted actually inserted, use the command addition ACCEPTING DUPLICATE KEYS. If there is an error, this addition suppresses the runtime error (and thus also the database rollback), sets the return code (sy-subrc) to 4, and inserts all the records without errors.The sy-dbcnt system field contains the number of rows that were successfully inserted in the database.

Regards,

Balaji Reddy G

***Rewards if answers are helpful

Read only

jayanthi_jayaraman
Active Contributor
0 Likes
605

Hi,

If you want to insert records into database table,

data : itab type standard table of ztable,

wa type ztable.

wa-f1 = 'ABC'."some valid value according to your fields

wa-f2 = 'CDE'."some valid value according to your fields

wa-f3 = 'EFG'."some valid value according to your fields

wa-f4 = 'GEH'."some valid value according to your fields

append wa to itab.

...."append similarly other records

insert ztable from table itab.