Hi all, I'm a junior developer and I'm having troubles trying to delete a zdttable. I'm using my code inside a Web Dynpro. When I call delete sentence for first time it doesn´t work, but when I try again it works fine. I don´t know really why can this be happening. Can someone help me please??. Thanks.
Bellow my code:
loop at lt_rms_documents into ls_rms_documents.
if ( ls_rms_documents-object_type eq 'BUS2201' ) or ( ls_rms_documents-object_type eq 'BUS2000113' ).
clear:ls_ztb_ahorro_saving.
select *
from ztb_ahorro_save
into ls_ztb_ahorro_saving
where guid_expediente = ls_expediente-guid_expediente and
cod_expediente = ls_expediente-cod_expediente and
object_id = ls_rms_documents-object_id .
endselect.
delete from ztb_ahorro_save where guid_expediente = ls_ztb_ahorro_saving-guid_expediente
and object_id eq ls_ztb_ahorro_saving-object_id.
* DELETE ztb_ahorro_save FROM ls_ztb_ahorro_saving.
commit work.
wait up to 3 seconds.