Skip to Content
0
Former Member
Feb 10, 2009 at 08:20 PM

Dynamic where clause in deleting table entries

2333 Views

Hello all i want to delete rows of Itab from a dynamic table based upon dynamic field and dynamic values. i hope you got it.

eg. i am using some field symbol to assign value for field name dynamically and field value dynamically. i want to use them to delete data fro dynamic table based upon where condition

my read feature is working fine to read data from dynamic table based upon dynamic field name and dynamic value.

ASSIGN component 'FROM_F' OF STRUCTURE <wa_ITAB2> TO <dyn_FIELD>.

ASSIGN component <wa_it1>-to_f of structure <WA_itab1> to <DYN_FIELDVALUE>.

READ table <dyn_tab1> ASSIGNING <dyn_watab1> WITH KEY (<DYN_Fieldname>) = <DYN_FIELDvalue> BINARY SEARCH.

ITS WORKING FINE.

i want to use something like this to delete table's data

data: v_strng(200) type c,

it_where like table of v_strng.

concatenate '<DYN_Field>' 'NE' '<DYN_FIELDvalue>' into v_strng.

append v_strng to it_where .

Delete <dyn_itab5> where (it_where) .

i tried this way also

Delete <dyn_itab5> where <DYN_Field> <> <DYN_FIELDvalue>.

is is possible either way?

i hope i cleared my intention.

Mani