2006 Aug 23 7:52 AM
I have a table ZVDELIVERY.
It contains data under columns such as Plant, Material No.,BoxNo., BoxSize etc.
Plant and Material No. are primary keys.
The material code MATNR is a 18 digit number e.g. 21FA2P2021A3551ADZ etc. I have to delete all that material from this table whose MATNR has first four digits as 21FA, 21FB and 21FC.
Can someone please write the required code for me. I have no exposure to ABAP programming hence this request please.
Regards,
Vinay.
2006 Aug 23 7:57 AM
data itab like ZVDELIVERY occurs 0 with header line.
start-of-selection.
select * from ZVDELIVERY in to table itab.
loop at itab.
if itab-matnr CA '21FA' or
itab-matnr CA '21FB' or
itab-matnr CA '21FC'.
delete ZVDELIVERY from itab.
endif.
endloop.
hope this helps!!
Thanks ,
Harkamal
2006 Aug 23 7:58 AM
DATA: T_DELIV TYPE ZVDELIVERY OCCURS 0 WITH HEADER LINE.
SELECT * FROM ZVDELIVERY INTO T_DELIV.
LOOP AT T_DELIV.
IF T_DELIV-MATNR(4) = '21FA' OR T_DELIV-MATNR(4) = '21FB' OR T_DELIV-MATNR(4) = '21FC'.
DELETE T_DELIV.
ENDLOOP.
MODIFY ZVDELIVERY FROM TABLE T_DELIV.
2006 Aug 23 8:08 AM
delete from zvdelivery where matnr like '21FA%' or matnr like '21FB%' or matnr like '21FC'.
regards,
Hans
2006 Aug 23 8:08 AM
hi alok,
try this...
IF ( itab-matnr+0(4) = 'Z1FA' ) OR
( itab-matnr+0(4) = 'Z1FB' ) OR
( itab-matnr+0(4) = 'Z1FC' ).
delete ZVDELIVERY from table itab.
endif.
hope this helps,
priya.
2006 Aug 23 8:10 AM
HI Alok
You can do it in single statment using.
delete from ZVDELIVERY where matnr like '21FA%' or
mantr like '21FB%' or
matnr liek '21FC%'.
Hope this works for you.
Kind Regards
Eswar
2006 Aug 23 8:13 AM
Hello Alok,
Try like this.
<b> delete from ZVDELIVERY where matnr like '21FA%' or
mantr like '21FB%' or
matnr liek '21FC%'.
commit work and wait.</b>
If useful reward.
Vasanth