‎2012 Mar 13 1:38 PM
Hi,
I want to delete rows from internal table using where condition for select option .
I tried :
delete itab where vbeln < p_saldoc-low OR vbeln > p_saldoc-high.
But it gave an error.
then I tried:
delete itab where vbeln < p_saldoc-low.
delete itab where vbeln > p_saldoc-high.
Now im getting error: Field specification missing.
Pls Help with the best approach or possible solution........
‎2012 Mar 13 1:45 PM
You could also use the IN-operator, this is standard ABAP syntax, check the help files. There must be some other cause for the errors, please list the full and exact messages and also post the code, not just this small snippet.
Thomas
‎2012 Mar 13 1:45 PM
You could also use the IN-operator, this is standard ABAP syntax, check the help files. There must be some other cause for the errors, please list the full and exact messages and also post the code, not just this small snippet.
Thomas
‎2012 Mar 13 2:06 PM
Hi Thomas,
tried using IN but now im getting the error - p_saldoc is not an internal table.
‎2012 Mar 13 2:13 PM
‎2012 Mar 13 2:14 PM
‎2014 Oct 01 5:52 AM
could you please tell how you resolved the error " p_saldoc is not an internal table."
‎2012 Mar 13 1:46 PM
Faiz,
Some times, it might not work correctly. But I would prefer the below if the size of the p_saldoc-low/high is small. take a temporary internal table 'itab1'.
loop at p_saldoc-low.
read table itab into wa with key vbeln = p_saldoc-low.
if sy-subrc ne 0.
continue.
else.
append wa to itab1.
endif.
endloop.
Do the same for p_saldoc-high as well. This will work correctly.
If you are fetching the data from a table into itab, then use the stmt like this
select....from dbtab into itab where vbeln in p_saldoc. I dont know your requirement though..
Regards,
Guru.
‎2012 Mar 13 2:01 PM
HI
delete itab where vbeln in p_saldoc should work. Make sure your table is sorted on vbeln.
‎2012 Mar 13 2:13 PM
Hi,
we can use IN operator to fix the error like
delete itab where vbeln in p_saldoc.
Please share your requirement so that we can guide you in that way.
Hope this will helps you.
Many Thanks,
Kiran