Application Development 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: 

Compare two tables to delete specific rows

0 Kudos

Hello experts,

i want to delete rows from a z table when it matches rows from an internal table at a speficic row count.

so basicallly this

"delete from ztab where ztab-column = itab[ row_count ]-column."

exept it doesn't work.

If that makes any sense.

Thank you.

2 REPLIES 2

venkateswaran_k
Active Contributor
LOOP AT itab into wa_itab.
DELETE FROM ZTAB WHERE COL1 = WA_ITAB-COL1.
ENDLOOP.

Sandra_Rossi
Active Contributor
data(column) = itab[ row_count ]-column.
delete from ztab where column = column.

or with Host Expression (rewritten as minimal reproducible example):

DATA itab TYPE TABLE OF sflight.
DATA(row_count) = 1.
DELETE FROM sflight WHERE carrid = @( itab[ row_count ]-carrid ).