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

dele record.

Former Member
0 Likes
684

Hi All,

I deleted a record from the internal table which is it_scarr, this worked fine and sy-subrc = 0. Now I want to delete the record from table scarr from internal table and checked sy-subrc. Record is not deleted from the table and the value of sy-subrc = 4.

my code is:

delete it_scarr index 3.

if sy-subrc = 0.

endif.

delete scarr from it_scarr.

if sy-subrc = 0.

endif.

Please help me on this.

Thanks

6 REPLIES 6
Read only

Former Member
0 Likes
651

After you DELETE from DB table.....

Delete scarr from table it_scarr.

if sy-subrc = 0.

commit work.

else.

rollback work.

endif.

Thanks,

Deepak.

Read only

0 Likes
651

Hi, Thank you. Here, I am first deleting the record from the internal table which worked fine. Later deleting the table record, which is not working and sy-subrc = 4. in the econd case.

Read only

0 Likes
651

If you INSERT or DELETE records from DB table you have to COMMIT IT as I have gave you a piece of code.

Thanks,

Deepak.

Read only

0 Likes
651

Hi,

what is scarr ?

is it a field in internal table it_scarr?.

Regards

Read only

0 Likes
651

Scarr is table given by SAP.

Thanks.

Read only

Former Member
0 Likes
651

I figured it out what the problem is.