Hi Marina,
Single deletes will take lot of time....
Still you can directly filter the records during select itself FKSTO is Space this will not select the cancelled docs.
Now for your query delete on same table in loop is not recommended and also in large datasets it will be slow to delte single records.
ADD 1 more field in table as FLAG type c
itab_tmp[] = itab[].
Loop at itab_tmp into wa_tmp.
READ TABLE itab into wa_tmp with key vbeln = wa_tmp-sfakn.
if sy-subrc is initial.
wa_tmp-flag = 'X'.
modify itab from wa_tmp transporting flag where vbeln = wa_tmp-sfakn. " This will mark the original record.
modify itab from wa_tmp transporting flag where sfakn = wa_tmp-sfakn. " This will mark the cancel record.
endif.
endloop.
delete itab where flag = 'X'.
Regards