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 to Function Module parameter

Former Member
0 Likes
1,581

Hello,

I have a select options parameter in my report and then I have a function module that have to select into a database table using this SO.

How can I pass the SO to the FM?

The code must be something like that:


REPORT ZXXXX.

SELECT-OPTIONS:  so_werks FOR marc-werks.

CALL FUNCTION 'ZFUNCTION'




------------------------------------------------------------------------------------------

FUNCTION ZFUNCTION

 SELECT matnr FROM marc INTO TABLE it 
 WHERE werks IN so_werks

The select options must be a TABLES parameter? I have to create a structure type for that SO?

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,067

hi marshal,

1. In the FM (in se37), there should be one TABLES parameter

of type structure WERKS_RANG.

2. This WERKS_RANG has four fields, exactly similar to an internal table of select option.

So pass the select option as it is, using the tables parameter.

regards,

amit m.

5 REPLIES 5
Read only

Former Member
0 Likes
1,067

Hi Marshal,

You can pass by using Tables.

Pass the selection-option internal tables as a type of structure RSPARAMS .

Regards,

Sunil

Read only

Former Member
0 Likes
1,068

hi marshal,

1. In the FM (in se37), there should be one TABLES parameter

of type structure WERKS_RANG.

2. This WERKS_RANG has four fields, exactly similar to an internal table of select option.

So pass the select option as it is, using the tables parameter.

regards,

amit m.

Read only

0 Likes
1,067

Thanks to all

Read only

Former Member
0 Likes
1,067

Hi,

In FM interface you can use

structure EFG_RANGES ( In Tables Parameter ) . This structure is same as select options.

Or in Importing parameters use EFG_TAB_RANGES . This is an internal table type .

In both ways you can pass your select option to FM diretcly.

Check the following link as well

https://forums.sdn.sap.com/click.jspa?searchID=11071891&messageID=4908310

Regards,

Raj.

Read only

Former Member
0 Likes
1,067

Hi,

Its not possible to do that, since select-option is having lots of functionality, eg : single single reanges, select ranges,exclude ranges etc....

So better to use select query in program and pass the values to function module by using tables.

REWARD IF USEFUL