2007 Dec 04 10:40 AM
I have genereated a table maintenance for a custom table and maintaining values using the table maintenance.
The below code is quto generated.
INSERT ZCSC_EAP_BTI .
When I check in debug it returns sy-subrc = 4. But the values are not in the table.
What can be issue.
2007 Dec 04 11:02 AM
<b>Insert (into database) is valid in this format, but obsolete</b>
Read the ABAP help for the keyword INSERT, and you'll see that sy-subrc = 4 means:
<i>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.</i>
You should be able to use UPDATE rather than INSERT. Or just use MODIFY.
matt
Hi,
Try like this
INSERT INTO dbtab VALUES dbtab. OR
INSERT INTO scustom VALUES wa
Regards,
Prashant
2007 Dec 04 10:42 AM
Hi
SY-SUBRC = 4 means that stament not executed successfully
if it equals to zero then only that table fileds will be update d
2007 Dec 04 10:43 AM
Use syntax.
Insert ZCSC_EAP_BTI from <work area>.
commit work.Regards,
Satish
2007 Dec 04 10:43 AM
Hi,
Try like this
INSERT INTO dbtab VALUES dbtab. OR
INSERT INTO scustom VALUES wa
Regards,
Prashant
2007 Dec 04 10:48 AM
hi
the syntax for insert is :
INSERT INTO dbtab VALUES WA.
n if it sy-subrc returns any value other than '0' then the statement has not executed correctly.
regards,
sohi
2007 Dec 04 11:02 AM
<b>Insert (into database) is valid in this format, but obsolete</b>
Read the ABAP help for the keyword INSERT, and you'll see that sy-subrc = 4 means:
<i>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.</i>
You should be able to use UPDATE rather than INSERT. Or just use MODIFY.
matt
2007 Dec 04 11:15 AM
Since the insert statement is autogenerated by SAP by generating table maintenance. I donot want to change that code. I want to know what is the issue
2007 Dec 04 11:50 AM
check in your work area if there is any value present not
normally it occurs because you are trying to enter a value which is already present in the unique field of table
please cross check again may be it is u r missing some data
2007 Dec 04 12:07 PM
The issue is that you are trying to create a record with the same key as a record already in the table.
>Read the ABAP help for the keyword INSERT, and you'll
>see that sy-subrc = 4 means:
<b>>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.</b>
matt
| User | Count |
|---|---|
| 4 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |