2009 Oct 01 7:08 AM
i am using the functionality of select-options in function module
but unlike reports if i leave it blank rather than selecting all the data it comes blank.
how can i do that
my select query has 9 selection criteria and user may enter one two or three as per his need.
in that case the output comes out to be blank.
i checked even in forum but i could not get the answer
how this can be resolved
2009 Oct 01 7:12 AM
Hi,
You will have to define ranges in the function module corresponding to the select-options and use it in the select query in the function module.
Regards,
Vikranth
2009 Oct 01 7:17 AM
use range.
ranges : r1 for gs_itab-field1.
you can use this range in select statement,
you can also do this
r1-sign = 'I'.
r1-options = 'CP'.
r1-low= '*'.
append r1.
this way it will fetch all.
2009 Oct 01 7:22 AM
As an addition: No longer use the RANGES statement in ABAP. It's obsolete and on top of that you can't use it in classes. So better get rid of it.
2009 Oct 01 7:17 AM
Hi,
first make the select options as optional in the import paramters of the function module.
i am giving an example
MATNR TYPE RSELOPTION. <IN THE IMPORT PARAMTER>
NOW in the source code write as
SELECT * FROM mara INTO TABLE itab WHERE matnr IN matnr.
it will work.
Regards,
Nagaraj
2009 Oct 01 7:24 AM
Hi ,
Try this way.
Thanks
Venkat.O
DATA:s_matnr TYPE RANGE OF mara-matnr.
TABLES mara.
SELECT SINGLE * FROM mara WHERE matnr IN s_matnr.
2009 Oct 01 7:24 AM
link:[http://www.sdn.sap.com/irj/scn/advancedsearch;jsessionid=(J2EE3417500)ID0784339150DB02204806096016329031End?query=functionmoduleselect+options]