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

deleting rows from internal table using where condition

Former Member
0 Likes
9,193

Hi,

     I'm trying to delete records from an internal table based on a condition,

      but I'm getting "field specification missing" error.

     Pls help with the posible solution.   


DELETE it_excel WHERE ( ( valid_from between wa_tab-valid_from and wa_tab-valid_to )

OR ( valid_to  BETWEEN wa_tab-valid_from AND wa_tab_valid_to ) ) .

1 ACCEPTED SOLUTION
Read only

matt
Active Contributor
3,904

DELETE it_excel WHERE ( ( valid_from between wa_tab-valid_from and wa_tab-valid_to ) OR ( valid_to  BETWEEN wa_tab-valid_from AND wa_tab_valid_to ) ) .

should be

DELETE it_excel WHERE ( ( valid_from between wa_tab-valid_from and wa_tab-valid_to ) OR ( valid_to  BETWEEN wa_tab-valid_from AND wa_tab-valid_to ) ) .

Do try to read carefully...


DELETE it_excel WHERE ( ( valid_from between wa_tab-valid_from and wa_tab-valid_to ) OR ( valid_to  BETWEEN wa_tab-valid_from AND wa_tab_valid_to ) ) .

should be

DELETE it_excel WHERE ( ( valid_from between wa_tab-valid_from and wa_tab-valid_to ) OR ( valid_to  BETWEEN wa_tab-valid_from AND wa_tab-valid_to ) ) .

Do try to read carefully...


6 REPLIES 6
Read only

matt
Active Contributor
3,905

DELETE it_excel WHERE ( ( valid_from between wa_tab-valid_from and wa_tab-valid_to ) OR ( valid_to  BETWEEN wa_tab-valid_from AND wa_tab_valid_to ) ) .

should be

DELETE it_excel WHERE ( ( valid_from between wa_tab-valid_from and wa_tab-valid_to ) OR ( valid_to  BETWEEN wa_tab-valid_from AND wa_tab-valid_to ) ) .

Do try to read carefully...


Read only

sandeep_ramesh88
Explorer
0 Likes
3,904

DELETE it_excel WHERE ( ( valid_from between wa_tab-valid_from and wa_tab-valid_to )

OR ( valid_to  BETWEEN wa_tab-valid_from AND wa_tab-valid_to ) ) .

Please check....

Read only

RaymondGiuseppi
Active Contributor
0 Likes
3,904

If you want to delete overlapping intervals, the check can be simplified, if valid_from is always LE valid_to of course.

DELETE it_excel WHERE valid_to GE wa_tab-valid_from AND valid_from LE wa_tab-valid_to.

But is this your exact requirement, are you supposed to delete overlapping intervals or to merge them, what are supposed to do for

  • [2,3] and [1,4]
  • [1,3] and [2,4]

Regards,

Raymond

Read only

0 Likes
3,904

if 10 to 15 is there,

neither 1 to 14, nor 13 to 20 should come..

Read only

0 Likes
3,904

In this case my sample should do.

Regards,

Raymond

Read only

Former Member
0 Likes
3,904

Thanks a lot guys.....