Application Development and Automation 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: 
Read only

Delete statement

Former Member
0 Likes
942

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

10 REPLIES 10
Read only

Former Member
0 Likes
921

Try,

DELETE GT_DELIVERY_DATA WHERE WADAT_IST <b><></b> R_WADATO.

Shreekant

Read only

Former Member
0 Likes
921

how r u populating <b>R_WADATO</b>?

Read only

Former Member
0 Likes
921

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

Read only

Former Member
0 Likes
921

try this way...

<b>SORT GT_DELIVERY_DATA BY WADAT_IST.

DELETE GT_DELIVERY_DATA WHERE WADAT_IST NOT IN R_WADATO.</b>

Read only

Former Member
0 Likes
921

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

Read only

0 Likes
921

You have to use delete FROM on itabs.. ie

DELETE FROM GT_DELIVERY_DATA WHERE WADAT_IST NOT IN R_WADATO.

~Suresh

Read only

0 Likes
921

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.

Read only

0 Likes
921

Yes.. its the other way round.. DELETE from dbtab & delet itab.

sorry .. hey I can blame it on Friday the 13th!

~Suresh

Read only

0 Likes
921

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.

Read only

Former Member
0 Likes
921

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>