‎2014 Jan 23 1:46 PM
i have a code like below
DELETE lt_cddetails WHERE tabname EQ 'KONDAT' AND
( f_old EQ '00.00.000' OR chngind EQ 'I' )
If this internal table contains f_old as 00/00/0000 it is not deleting that entry. Is there any way to delete this for all null values ? ( other than adding all possible formats in OR condition ?
Regards,
Praveen
‎2014 Jan 23 1:52 PM
hi,
date store internally different format so try this
DELETE lt_cddetails WHERE tabname EQ 'KONDAT' AND
( f_old eq '00000000' OR chngind EQ 'I' )
thanks
‎2014 Jan 23 1:55 PM
You can use delete itab wher f_old is initial. did you search before posting?
‎2014 Jan 23 2:26 PM
Check Below code
TYPES:
BEGIN OF t_date,
date TYPE sy-datum,
END OF t_date.
DATA:
i_date TYPE TABLE OF t_date,
i_date_line TYPE t_date.
i_date_line-date = sy-datum.
APPEND i_date_line TO i_date.
CLEAR i_date_line.
APPEND i_date_line TO i_date.
DELETE i_date WHERE date IS INITIAL.
Thanks
‎2014 Jan 23 2:37 PM
Here f_old is String type not of type sy-datum.
Regards,
Praveen
‎2014 Jan 23 2:52 PM
If the string data is not provided with a fixed format, you could expect a null value to contain only space, '0', '.', '-' and '/', So you could use a test like
WHERE f_old CO ' 0.,-/'.
(ref - log_exp - Comparison Operators for Character-Like Data Types)
Regards,
Raymond
‎2014 Jan 24 5:40 AM
try like this
DELETE lt_cddetails WHERE tabname EQ 'KONDAT' AND
( f_old is intial OR chngind EQ 'I' )
‎2014 Jan 24 6:07 AM
F_old is string field we can't use initial here.Here CO '0./- ' is working for me.
Regards,
Praveen
‎2014 Jan 24 6:19 AM
hi
delete FROM tabnam WHERE date <= '01.01.0001' and field = 'xxx'.
I think it gives u the answer u required.
regards,
N.SUDHAKAR