2007 Nov 28 8:00 PM
Hi all SAP Gurus,
I have a code in my function module as below:
Like:
ranges: r_alt for mast-stlal,
r_date for stko-datuv,
r_plant for mast-werks,
r_product_code for mara-matnr.
Alt , Product_code , date and plant are the import parameters
if not alt is initial.
r_alt-sign = 'I'.
r_alt-option = 'EQ'.
r_alt-low = alt.
append r_alt.
endif.
if not date is initial.
r_date-sign = 'I'.
r_date-option = 'EQ'.
r_date-low = date.
append r_date.
endif.
if not plant is initial.
r_plant-sign = 'I'.
r_plant-option = 'EQ'.
r_plant-low = plant.
append r_plant.
endif.
IF NOT product_code IS INITIAL.
r_product_code-sign = 'I'.
r_product_code-option = 'EQ'.
r_product_code-low = product_code.
APPEND r_product_code .
ENDIF.
SELECT a~matnr
INTO TABLE t_mast
FROM mast AS a
INNER JOIN stko AS k
ON astlnr EQ kstlnr
AND astlal EQ kstlal
WHERE a~werks in r_plant
AND a~stlal in r_alt
AND k~datuv in r_date
AND a~matnr in r_product_code .
If I give the product code input as a wild search, I am not getting the data..For example if I want all the data for which the product code starts with C ( Say C*) ,
the program is not working.Please tell me how to get the data for wild searches .
Vishnu.
2007 Nov 28 8:04 PM
If the value is 'C*', then you also have to change r_product_code-option to 'CP'.
Rob
Hi all SAP Gurus,
I have a code in my function module as below:
Like:
ranges: r_alt for mast-stlal,
r_date for stko-datuv,
r_plant for mast-werks,
r_product_code for mara-matnr.
Alt , Product_code , date and plant are the import parameters
if not alt is initial.
r_alt-sign = 'I'.
r_alt-option = 'EQ'.
r_alt-low = alt.
append r_alt.
endif.
if not date is initial.
r_date-sign = 'I'.
r_date-option = 'EQ'.
r_date-low = date.
append r_date.
endif.
if not plant is initial.
r_plant-sign = 'I'.
r_plant-option = 'EQ'.
r_plant-low = plant.
append r_plant.
endif.
IF NOT product_code IS INITIAL.
r_product_code-sign = 'I'.
r_product_code-option = 'EQ'.
r_product_code-low = product_code.
APPEND r_product_code .
ENDIF.
SELECT a~matnr
INTO TABLE t_mast
FROM mast AS a
INNER JOIN stko AS k
ON astlnr EQ kstlnr
AND astlal EQ kstlal
WHERE a~werks in r_plant
AND a~stlal in r_alt
AND k~datuv in r_date
AND a~matnr in r_product_code .
If I give the product code input as a wild search, I am not getting the data..For example if I want all the data for which the product code starts with C ( Say C*) ,
the program is not working.Please tell me how to get the data for wild searches .
Vishnu.
2007 Nov 28 8:04 PM
If the value is 'C*', then you also have to change r_product_code-option to 'CP'.
Rob
2007 Nov 28 8:16 PM
2007 Nov 28 8:22 PM
Glad to help - will you have to deal with ranges and complex patterns as well?
Rob
2007 Nov 28 9:46 PM
Yes Rob.I have a requirement where in I have to use a wild search for material.
2007 Nov 28 8:04 PM
Hi Vishwa,
Use Select-Options for Alt , Product_code and plant and try.
Regards,
Satish