09-23-2008 10:20 AM
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.
09-23-2008 10:24 AM
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>.
09-23-2008 10:24 AM
Hi,
Check whether database table structure is same as internal table. Also there might be the data present with same key field.
Thanks.
Swati
09-23-2008 10:26 AM
09-23-2008 10:29 AM
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
09-23-2008 10:31 AM
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
09-23-2008 10:39 AM
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
09-23-2008 10:39 AM
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.
09-23-2008 10:55 AM
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.
09-23-2008 2:31 PM
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