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

Insertion a record into database table

Former Member
0 Likes
1,265

Hi All,

I ahve written code to insert a recrod into database table.

eg : INSERT INTO smen_buffc VALUES wa_smen_buffc.

the work area contains same structure as that of table name smen_buffc.

but when i execute it returns sy-subrc value as 4.

what is the reason y it is not inserting the rows.

pls help me

urgent

9 REPLIES 9
Read only

Former Member
0 Likes
1,130

hi,

Check the data that you are inserting.

Read only

Former Member
0 Likes
1,130

hi,

Goto SM12 transaction and check whether the table is locked ....if so then unlock the table and then try inserting the entires in to the table ..

Regards,

Santosh

Read only

Former Member
0 Likes
1,130

Praveen,

Check in SE11 whether with the same key data available in table already?if so than this entry would not be enter.

Amit.

Read only

0 Likes
1,130

Hi Praveen,

This is the meaning of sy-subrc = 4:

At least one row could not be inserted, because the database table already contains a row with the same primary key or a unique secondary index.

Thanks,

Victor.

Read only

Former Member
0 Likes
1,130

Hi Parveen,

Try it this way.

INSERT Internal_table into Database_table.

and also check that there should not any duplicate values of primary key.

hope this will work.

Thanks & Regards.

Rajesh Kumar.

Read only

Former Member
0 Likes
1,130

hi....

The reason may be that you are inserting dulicate entriesi.e.the entry must be already existing in the table.

In that case it is giving sy-subrc = 4.

check your table again.....

Read only

0 Likes
1,130

means similar data with same key already exists....

check your table entries

after insert... use the statement Modify..

Regards,

VIjay

Edited by: Vijay on Jul 1, 2008 11:00 AM

Read only

0 Likes
1,130

hi,

I am inserting new entries into the table.

I am getting sy-surbc eq 0.

When i check the table the data is not inserted into the table.

y is it soo?

Read only

Former Member
0 Likes
1,130

I am inserting new entries into the table still the records are not inserted into the tables.

I am getting sy-subrc =0. When I check it in the table. the data is not inserted.