Application Development 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: 

Dump at INSERT Statement

Former Member
0 Kudos

Hello All,

Im reading data from a local file to a internal table. The internal table is also getting populated with those values. With this internal table Im inserting records into a Database Table. This internal table is having same structure as Database table.

But Im getting the following dump.

"RSQL error 13 when accessing table "Y16V_AO_LEVEL_IN ".

Plese find my code beow:

DATA: G_T_Y16V_AO_LEVEL_IN TYPE TABLE OF
          Y16V_AO_LEVEL_IN WITH HEADER LINE.

      INSERT y16v_ao_level_in FROM TABLE g_t_y16v_ao_level_in.

Good answers will be appreciated.

Thanks in advance.

Best Regards,

Sasidhar Reddy Matli.

9 REPLIES 9

Former Member
0 Kudos

You need to specify all the fields present in database table and put the data in all fields before inserting the data...

Paste some more piece of code wherein you are moving the data to the database table before insert statement...

Also, correct the code as

Insert into <database table> from table <workarea>.

Former Member
0 Kudos

Hi,

Check whether database table structure is same as internal table. Also there might be the data present with same key field.

Thanks.

Swati

Sathish
Employee
Employee
0 Kudos

Use

INSERT INTO dbtab FROM TABLE itab_wa.

Former Member
0 Kudos

Hi,

The dump might be because of duplicate entries or records have the same key fields in the table with your using to insert.

Thanks & Regards

Vijaya

naveen_inuganti2
Active Contributor
0 Kudos

Hi...

Declare one work area and try to upload the entries.

Or..,

This may occurs because if you try to update the same file second time.

Hope you understand with following analysis..,

If you use an ABAP/4 Open SQL array insert to insert a record in
 the database and that record already exists with the same key,
 this results in a termination.

Thanks,

Naveen.I

Former Member
0 Kudos

Hi

your query is correct.But the problem is data while yoy are inserting into the table it violates the key relation.

Here there might be two reasons

1.Already some data might be there in the table with same key fields which you are going to insert from the internal table

2.Otherwise in your internal table some duplicate records may be there

regrads

venkat

Former Member
0 Kudos

Dear Sasidhar,

try this

Tables: ZEMP.

DATA: BEGIN OF ITAB OCCURS 0,

NAME TYPE ZEMP-NAME,

END OF ITAB.

DATA: WA LIKE LINE OF ITAB.

UPLOAD ALL THE DATA INTO ITAB.

LOOP AT ITAB INTO WA.

ZEMP-NAME = WA-NAME.

INSERT ZEMP.

COMMIT WORK.

CLEAR WA.

ENDLOOP.

0 Kudos

hi,

it may be due to duplicate entries or records have the same key fields in the table .

you can use modify statement insead of insert.

Former Member
0 Kudos

hi

I can suggest u donot use INSERT statement but use MODIFY Statement so that if that record exist then the previous record is to be modified .and not exist then it will be inserted in the table.

rewards if useful..

regards

Sachhi