‎2008 Dec 16 4:38 AM
Hi All,
i have created a search help with input parameters. i have a material number as a input field and other parameters as well and MARA is the selection table. When i enter material no, say XX_XXXXX* in the input field, i expect to get all the materials in that pattern in the hitlist. Problem is matnr stored in other format in MARA say XXXXXXXXXX. So its returning null entries..
how to handle this problem
Regards
Shekhar
‎2008 Dec 16 4:52 AM
Hi,
For an single character wild card you need to use '+' instead of '_'. So try using + in place of _ for the wild card search. It might resolve your problem.
Regards,
Ramesh
‎2008 Dec 16 4:58 AM
Hi Ramesh,
its not a single character wild card. I mean to say Matnr is stored in that format.. ex: 9C_73929922
Regards
Mahesh
‎2008 Dec 16 5:18 AM
Hi Shekar..
this is sample code just copy and execute. it to set your desired result..i think it will set you requirement.
******************************
SAMPLE CODE:
-
REPORT ZGSHELP .
tables: vbak,vbap,likp,lips.
parameters: p_vbeln like vbak-vbeln.
at selection-screen on p_vbeln.
ranges: gr_vbeln for vbak-vbeln.
data: begin of gt_vbeln occurs 0,
vbeln like vbak-vbeln,
end of gt_vbeln.
data: gv_repid type sy-repid,
gv_dynnr type sy-dynnr.
gr_vbeln-sign = 'I'.
gr_vbeln-option = 'CP'.
gr_vbeln-low = p_vbeln.
append gr_vbeln.
select vbeln
from vbak
into table gt_vbeln
where vbeln in gr_vbeln."5000000355
where vbeln like '50000005'.
if sy-subrc eq 0.
call function 'F4IF_INT_TABLE_VALUE_REQUEST'
exporting
retfield = 'VBELN'
DYNPPROG = gv_repid
DYNPNR = gv_dynnr
DYNPROFIELD = 'P_VBELN'
tables
value_tab = gt_vbeln.
endif.
******************************
UR's
GSANA