‎2007 Jul 18 2:06 PM
hi all,
i want to retrive the data of particular material for eg : starting with ' D '
using READ statement.
iam using like this:
READ TABLE IT_PROP INTO WA_PROP WITH KEY MATNR = 'C%'.
it s not working.
‎2007 Jul 18 2:10 PM
Hi,
use 'D%'
in place of 'C%'
Reward points, if helpful,
Sandeep Kaushik
Message was edited by:
Sandeep Kaushik
‎2007 Jul 18 2:08 PM
loop at it_prop where matnr cp 'D*'.
exit.
endloop.
if sy-subrc = 0.
write:/ it_prop-matnr 'starts with D'.
endif.
Regards,
Ravi
‎2007 Jul 18 2:08 PM
Hi try this :
DATA : V1(3) VALUE '25%',
V2(3) VALUE '45%',
V3(3) VALUE '55%'.
SELECT EBELN EBELP MATNR WERKS PSTYP MENGE MEINS NETPR MWSKZ NAVNW
INCO1 INCO2 LGORT UNTTO UEBTO LOEKZ KNTTP WEPOS REPOS
WEUNB PEINH INFNR BANFN BNFPO ANFNR ANFPS TXZ01 WEBRE
from ekpo into table i_ekpo
where ( ebeln like v1 or
ebeln like v2 or
EBELN LIKE V3 )
AND WERKS NOT IN ('ADMM','LGHS','XO01','NGM1','ADMN')
AND LOEKZ EQ SPACE
AND ELIKZ EQ SPACE.
Reward points if helpful
Srikanta Gope
‎2007 Jul 18 2:09 PM
It is not possible with read.
s_matnr-sign = 'I'.
s_matnr-option = 'CP'.
s_matnr-low = 'C%'.
append s_matnr.
loop at itab where matnr in s_matnr.
*-Here you get the record.
endloop.
regards
Vijay
‎2007 Jul 18 2:09 PM
define in range for material like below
ranges: r_matnr for mara-matnr.
r_matnr-sign = 'EQ'.
r_matnr-option = 'CP'.
r_matnr-low = 'C%'. "The material code letters which are looking for
append r_matnr.
clear r_matnr.
READ TABLE IT_PROP INTO WA_PROP WITH KEY MATNR in r_matnr.
check sy-subrc = 0.
‎2007 Jul 18 2:10 PM
Hi,
in ABAP the symbol % is * but however the READ statement doesn't work with a partial key.
Try with
loop at it_prop into wa_prop where matnr CP 'C*'.
bye
‎2007 Jul 18 2:11 PM
if you are interested in a single record put an exit in the loop...
loop at .....
....
....
....
exit.
endloop.
‎2007 Jul 18 2:10 PM
LOOP AT IT_PROP INTO WA_PROP WHERE MATNR = 'C%'.
* Do you stuff here
ENDLOOP.
‎2007 Jul 18 2:10 PM
Hi,
use 'D%'
in place of 'C%'
Reward points, if helpful,
Sandeep Kaushik
Message was edited by:
Sandeep Kaushik
‎2007 Jul 18 2:10 PM
ouch, I didn't see those answers when posting -
-
You cannot use masks with READ TABLE. Maybe you can try with something like
LOOP AT it_prop INTO wa_prop WHERE matnr LIKE 'D%'.
EXIT.
ENDLOOP.If you cannot use the LIKE option, try to make a RANGES for matnr and use "matnr IN range".
Message was edited by:
Vicenç Lozano