‎2007 Apr 13 6:14 PM
Hi folks,
the following statement is not working.
DELETE GT_DELIVERY_DATA WHERE WADAT_IST NOT IN R_WADATO.
GT_DELIVERY_DATA -
internal table
wadat_ist -
date
r_wadato -
date range.
thanks in advance
rao
‎2007 Apr 13 6:21 PM
Try,
DELETE GT_DELIVERY_DATA WHERE WADAT_IST <b><></b> R_WADATO.
Shreekant
‎2007 Apr 13 6:26 PM
‎2007 Apr 13 6:26 PM
Try this:
SORT GT_DELIVERY_DATA BY WADAT_IST.
DELETE GT_DELIVERY_DATA WHERE WADAT_IST NOT IN R_WADATO.
or try this:
SORT GT_DELIVERY_DATA BY WADAT_IST.
DELETE GT_DELIVERY_DATA WHERE WADAT_IST GE R_WADATO-LOW AND WADAT_IST LE R_WADATO-HIGH
Thanks,
SKJ
‎2007 Apr 13 6:31 PM
try this way...
<b>SORT GT_DELIVERY_DATA BY WADAT_IST.
DELETE GT_DELIVERY_DATA WHERE WADAT_IST NOT IN R_WADATO.</b>
‎2007 Apr 13 6:32 PM
the best thing would be to filter in the select query itself.
check this
R_WADATO-SIGN = '<b><i>E'</i></b>.
R_WADATO-OPTION = 'EQ'.
R_WADATO-LOW = 'your date'.
APPEND R_WADATO.
R_WADATO-LOW = 'your date'.
APPEND R_WADATO.
in the select query,
select (........)
where WADAT_IST IN R_WADATO.
Shreekant
‎2007 Apr 13 6:36 PM
You have to use delete FROM on itabs.. ie
DELETE FROM GT_DELIVERY_DATA WHERE WADAT_IST NOT IN R_WADATO.
~Suresh
‎2007 Apr 13 6:42 PM
Hi Suresh,
this program compiled fine for me,
REPORT Z_TEST.
data:
begin of fs_date,
erdat type erdat,
end of fs_date,
i_date like table of fs_date.
ranges:
r_date for vbak-erdat.
DELETE i_date where erdat not in r_date.
‎2007 Apr 13 6:47 PM
Yes.. its the other way round.. DELETE from dbtab & delet itab.
sorry .. hey I can blame it on Friday the 13th!
~Suresh
‎2007 Apr 13 6:55 PM
check this program, it works absolutely fine,
REPORT Z_TEST2.
data:
begin of fs_date,
erdat type erdat,
end of fs_date,
i_date like table of fs_date.
ranges:
r_date for vbak-erdat.
r_date-sign = 'I'.
r_date-option = 'BT'.
r_date-low = '20070101'.
r_date-high = '20070413'.
APPEND r_date.
select erdat
into table i_date
from vbak.
delete adjacent duplicates from i_date comparing erdat.
DELETE i_date where erdat not in r_date.
loop at i_date into fs_Date.
write:/ fs_date-erdat.
endloop.
‎2007 Apr 13 6:50 PM
You can try to change the NOT IN logical expression to the following:
DELETE GT_DELIVERY_DATA WHERE WADAT_IST lt R_WADATO-LOW or WADAT_IST gt R_WADATO-HIGH.See if this works.
<i><b>Points are always welcome!!</b></i>