‎2006 Jul 25 3:27 AM
Hi Experts,
I'm trying to select materials based on description on where condition using contains pattern as a range, though there are materials, none of are found, Can you advise me what am I doing wrong please?
st_matnr-sign = 'I'.
st_matnr-option = 'EQ'.
st_matnr-low = w_matnr_low.
st_matnr-high = w_matnr_high.
APPEND st_matnr TO t_matnr.
st_maktg-sign = 'I'.
st_maktg-option = 'CP'.
st_maktg-low = p_desc.
APPEND st_maktg TO t_maktg.
SELECT a~mandt
a~matnr
a~spras
a~maktx
a~maktg
FROM makt as a
INNER JOIN mara as b
on amatnr = bmatnr
INTO TABLE t_alv_makt
WHERE a~matnr IN t_matnr
AND a~maktg IN t_maktg
AND b~mtart = 'ZIZS'.
Thanks,
GP.
‎2006 Jul 25 3:41 AM
TRY:
st_matnr-option = 'BT'.
ALSO, what is in p_desc. The CP needs '*' or similar to work properly.
‎2006 Jul 25 4:06 AM
Hi Neil,
Thanks for your reply, I've added 'BT' still no entries found in the table, yes I'm keying in with material in the description.
Please advise...
‎2006 Jul 25 4:31 AM
if your material is in lower case it will not work...try MATERIAL.
‎2006 Jul 25 4:48 AM
Hi Neil,
I'm refering to the data element maktg which is for uppercase for search help in MAKT table, it automatically is converting the description into upper case regardless how it was entered, without having to translate w_desc to uppercase. Still doesn't return values.
Please advise.
Thanks...
GP.
‎2006 Jul 25 5:02 AM
It will convert it if it's being entered uinto a screen field referring to that but if it's copie from another variable it won't convert.
try a process of elimination. take out the where clause components until you get some data and then you will have something to focus on. i.e. the culprit will be revealed even if you don't know why he's guilty.
It's also possible that the matnr field has a conversion exit attached and you need to take that into account when populating your variable. eg to remove or add in leading zeroes.
‎2006 Jul 25 5:42 AM
gibve like this and try...
st_matnr-sign = 'I'.
st_matnr-option = 'EQ'.
st_matnr-low = w_matnr_low.
APPEND st_matnr TO t_matnr.
st_matnr-sign = 'I'.
st_matnr-option = 'EQ'.
st_matnr-high = w_matnr_high.
APPEND st_matnr TO t_matnr.