‎2009 Jul 25 6:23 AM
dear all
i want to delete internal table where matnr = '*J'. my material code is like 'E5178MPO80/095SJ'. so i want to delete where last character is J.
advance thanks
regards
p sree hari
‎2009 Jul 25 6:37 AM
HI,
Use this code,
Loop at itab.
if itab-matnr+15(1) = 'J'.
delete itab.
endif.
endloop.Regards.
‎2009 Jul 25 10:25 AM
Hi,
Try this way..
RANGES : R_MATNR FOR MARA_MATNR.
R_MATNR-SIGN = 'I'.
R_MATNR-OPTION = 'CP'.
R_MATNR-LOW = '*J'.
APPEND R_MATNR. CLEAR R_MATNR.
DELETE ITAB WHERE MATNR IN R_MATNR.
‎2009 Jul 25 12:18 PM
please don't use ranges for internal tables. there is no advantage.
The first solution is o.k., but use no headerlines,
... see below ....
Edited by: Siegfried Boes on Jul 27, 2009 1:39 PM
‎2009 Jul 27 12:13 PM
Hi,
No need of loop here.
delete itab where matnr+17(1) = 'J'. " deletes all the matnr ending with 'J'.
conclusion as
data : matnr type matnr,w_i type i .
matnr = '000000000000000023'.
w_i = matnr+17(1).
write w_i . " Answer is 3 here
hope this might be helpfull,
Regards,
Aby
‎2009 Jul 27 12:25 PM
why not simply use
DELETE itab WHERE MATNR CP '*J'.?
Thomas
‎2019 Sep 20 8:14 AM
‎2009 Jul 27 12:44 PM
E5178MPO80 /095SJ
LOOP AT itab ASSIGNING <fs>.
IF ( <fs>-matr+16(1) = 'J' ).
DELETE itab INDEX sy-tabix.
ENDIF.
ENDLOOP.
I have my doubts that the WHERE-condition also offset manipulation.
The CP is probably less efficient than something with one offset check.
It depends on size of itab.
Please, recount the offset, there are no proposals between 15 and 17
Siegfried