04-19-2006 7:13 AM
Dear All,
I want to get data from Table MARA from field PRDHA. PRDHA is 18 char. Now on selection screen user inputs first 1-3 characters of PRDHA then fetch data from MARA accordingly and if user enters 9-17 characters of PRDHA then fetch data from MARA accordingly.
I have inserted data from select-option into Ranges internal table and then used '*' (wildcard) and then passing the same in the where condition of select option.
But its not returning the data.
Can someone help please.
04-19-2006 7:16 AM
Anurag,
You cannot use * as the wild characater in the WHERE clause. Use % and it will work.
Regards,
Ravi
Note : Please close the thread if this resolves the issue
04-19-2006 7:18 AM
HI
GOOD
IF POSSIBLE SEND THE SELECT STATEMENT THAT YOU R USING TOO FETCH THE DATA FROM MARA.
THANKS
MRUTYUN
04-19-2006 7:31 AM
Hi Anurag,
dont think % or * will work for a variable in select statement. wat u can do is select the materials from mara and then filter it from the internal table by some logic..
something like this
loop at itab.
if itab-prdha(3) = var.
move itab to itab1.
append itab1.
endif.
endloop.
ur itab1 will contain the relevant entries.
RHope it helps,
Regards,
Bikash
04-19-2006 7:55 AM
Hello Anurag,
use the following code...
tables: mara.
parameters p_prdha like mara-prdha.
concatenate '%' p_prdha '%' into p_prdha.
select * from mara where prdha like s_prdha.
break-point.
endselect.