Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

select options in function module

Former Member
0 Likes
985

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

6 REPLIES 6
Read only

Former Member
0 Likes
761

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

Read only

Former Member
0 Likes
761

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.

Read only

0 Likes
761

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.

Read only

former_member404244
Active Contributor
0 Likes
761

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

Read only

venkat_o
Active Contributor
0 Likes
761

Hi , Try this way.


DATA:s_matnr TYPE RANGE OF mara-matnr.
TABLES mara.
SELECT SINGLE * FROM mara WHERE matnr IN s_matnr.
Thanks Venkat.O

Read only

kesavadas_thekkillath
Active Contributor
0 Likes
761

link:[http://www.sdn.sap.com/irj/scn/advancedsearch;jsessionid=(J2EE3417500)ID0784339150DB02204806096016329031End?query=functionmoduleselect+options]