Skip to Content
0
K C
Dec 26, 2007 at 08:02 AM

Product hierarchy query

114 Views

i have to fetch materials from mara based on Product hierarchy but with one condition

If the user specify product hierarchy as ‘1000Y’ (2 levels) , it should pull all the materials with product hierarchy as ‘1000Y*’ for example – either ‘1000Y’ OR ‘1000Y02T’ OR ‘1000Y02T09R0TT’ etc

code is

select matnr lvorm into table int_matnr from mara where

matnr in s_matnr and

spart = p_spart and

mtart in p_mtart and

prdha in p_prdha and

lvorm ne 'X'.

i do not want to specify "1000Y*" in selection screen rather just on ntering 1000y it shud by default get 1000y* values. right now only wen i enter 1000y* in selection screen then only it fetches all materials with PH 1000Y or greater otherwise if i enter 1000y it does not give values