06-19-2008 6:38 AM
Hi,
I want to delete an itab and the condition is the filed name TEXT first 2 char is ne select option and also not to delete if the first 2 char is 'GE'.so how to write the code in this condition.Pls help to solve this issue
Thanks,
Deesanth
06-19-2008 6:42 AM
Hi Deesanth,
Here is the solution.
Loop at itab.
IF itab-text+0(2) NE S_OPTION-LOW
or itab-text+0(2) GE S_OPTION-LOW.
Delete itab index sy-tabix.
ENDIF.
Endloop.
&*******************Reward Point if helpful****************&
06-19-2008 6:42 AM
Hi Deesanth,
Here is the solution.
Loop at itab.
IF itab-text+0(2) NE S_OPTION-LOW
or itab-text+0(2) GE S_OPTION-LOW.
Delete itab index sy-tabix.
ENDIF.
Endloop.
&*******************Reward Point if helpful****************&
06-19-2008 6:44 AM
Hi,
Try this.
data : w_2(2) type c,
index type sy-tabix.
Loop at itab.
index = sy-tabix.
w_2 = itab-text + 0(2).
If w_2 ne s_option-low and w_2 gt s_option-high.
delete itab index index.
endif.
clear : w_2, index.
endloop.
Reward pts if useful.
Regards,
Dhan
06-19-2008 6:50 AM
I want to delete an itab and the condition is the filed name TEXT first 2 char is ne select option and also not to delete if the first 2 char is 'GE'.so how to write the code in this condition.Pls help to solve this issue
loop at itab into wa_itab.
if text+0(2) eq 'GE' and text+0(2) in so_options.
skip.
else.
delete itab index sy-tabix.
endif.
endloop.
06-19-2008 7:08 AM
REPORT Z_DELETE.
tables : vbap.
types : begin of ty_vbap,
vbeln type vbeln_va,
posnr type posnr_va,
matnr type matnr,
end of ty_vbap.
data : it_vbap type standard table of ty_vbap initial size 0,
wa_vbap type ty_vbap.
selection-screen : begin of block b1 with frame title text-001.
select-options : s_vbeln for vbap-vbeln.
selection-screen : end of block b1.
start-of-selection.
select vbeln
posnr
matnr
from vbap
into table it_vbap
where vbeln in s_vbeln.
if sy-subrc ne 0.
do nothing
endif.
delete it_vbap where ( vbeln0(2) ne s_vbeln ) and ( vbeln0(2) ge s_vbeln ).
loop at it_vbap into wa_vbap.
write : / wa_vbap-vbeln,
wa_vbap-posnr,
wa_vbap-matnr.
endloop.