‎2010 Jun 06 11:23 AM
Hi,
In my selection screen, i have material no.
i have to select the materials for the MARD table. for ex, if the user entered a mat no 12345600
i need result in the internal table like
12345600
12345601
12345602
12345603
12345604
For this, how to write the select query?
Thanks
Karthi.S
‎2010 Jun 06 12:00 PM
karthi,
how do you specify the logic of fetching the rest of the matnr? on what basis? any thing starting with '123456'.. if yes then a LIKE keyword in select statement that would do..
‎2010 Jun 06 12:00 PM
karthi,
how do you specify the logic of fetching the rest of the matnr? on what basis? any thing starting with '123456'.. if yes then a LIKE keyword in select statement that would do..
‎2010 Jun 06 1:49 PM
Hi,
this is answer for that.
LOOP at s_matnr.
CONCATENATE s_matnr-low+0(16) '%' into v_mat.
SELECT matnr werks lgort labst umlme
insme einme speme retme vmlab vmuml
from mard
INTO TABLE it_mard
WHERE matnr like v_mat and
werks in S_werks and
lgort in s_lgort.
CLEAR : v_mat.
Endloop.
‎2010 Jun 06 2:01 PM
this would cause you serious performance issues as you are selecting inside loop.
better modify the select option separately with adding a %...
then use select option at a time...
like..
loop at s_matnr.
s_mantnr-low+16 = '*'. "make the last char as '*'.. try with other options as well as well
s_matnr-option = 'CP'.
modify s_matnr.
endloop.
select ... from .... into table ... where matnr in s_matnr"this already keep CP
and ... and ..