2008 Sep 15 2:06 PM
data : it_mara type table of mara.
select * from mara
into it_mara.
delete it_mara where matnr = '100-100'
and meins = 'KG'.
if i do the same by using field symbols
i am getting data into <it_mara>
but
delete <it_mara> where matnr = '100-100'
and meins = 'KG'.
is showing syntax error
how to correct the error ?
2008 Sep 15 2:09 PM
you can do this...
data : it_mara type table of mara.
types: t_mara type standard table of mara.
field-symbols: <it_mara> type t_mara.
select * from mara
into table it_mara.
assign it_mara to <it_mara>.
delete <it_mara> where matnr = '100-100'
and meins = 'KG'.
2008 Sep 15 2:24 PM
I think, DELETE does not allows to dynamically define the logical expression for the WHERE clausule.
Have you tried by filtering data in SELECT statement??
Something like:
if dataBase = 'MARA'.
append 'MATNR <> '100-100'' to Itab_Where[].
append 'AND MEINS <> 'KG'' to Itab_Where[].
endIf.
...
select * from (dataBase) where (Itab_Where) into table <my_table>.
this is possible, but I don't know if this fits your requirements.
2008 Sep 15 3:05 PM