2009 Jul 24 7:20 AM
Hi experts
I need to delete the internal table records where vbeln like '40%'.
all the vbeln atarting with the number 40 i need to delete. if i use the like in where clause i am getting error.
Please suggest some solution on this
thanks in advance
sai
2009 Jul 24 7:26 AM
2009 Jul 24 7:22 AM
build a range table and use
data: ra_vbeln type standard table of selopt,
wa_vbeln type selopt.
wa_vbeln-sign = 'I'.
wa_vbeln-option = 'EQ'.
wa_vbeln-low = '40*'
append wa_vbeln to ra_vbeln.
delete tabe itab where vbeln in ra_vbeln.
2009 Jul 24 7:26 AM
2009 Jul 24 7:28 AM
Hello ,
you can use this trick ....
data: var1 type char2 .
loop at itab .
var1 = itab-vbeln+0(2) .
if var1 = '40' .
delete itab .
enidf.
endloop.
Thanks and regards..
Priyank
2009 Jul 24 7:28 AM
Hi,
You can try this way...
vbeln-sign = 'I'.
vbeln-option = 'CP'. " You sould use Contains Pattern when you use *
vbeln-low = '40*'
append vbeln .
delete tabe itab where vbeln in vbeln.
2009 Jul 24 7:29 AM
Hi,
use, DELETE itab where vbeln+0(2) = '40'.
Hope it works!!
Rgds,
Pavan
2009 Jul 24 7:33 AM
tables : vbak.
data: itab TYPE standard TABLE OF vbak.
start-of-selection.
SORT itab BY vbeln DESCENDING.
DELETE itab where vbeln = '40*'.
2009 Jul 24 7:37 AM
Hi .
I hope this code solved your problem .
Loop at itab where vbeln(2) = '40' .
delete itab .
continue .
endloop .