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

Function module with import as select options

Former Member
0 Likes
2,283

Hi All,

In my Function Module import parameter is select option say MATNR_FROM, MATNER_TO. In source code i write a range like this

data:r_matnr TYPE RANGE OF mseg-matnr,

r_matnr_line LIKE LINE OF r_matnr.

r_matnr_line-sign = 'I'.

r_matnr_line-option = 'BT'.

r_matnr_line-low = matnr_from.

r_matnr_line-high = matnr_to.

APPEND r_matnr_line TO r_matnr.

then

select matnr, maktx from makt into table it_maktx where MATNR in R_MATNR...

But i am not getting data in my internal table it_maktx....I thought problem is with RANGES...Could any one tell me or send me the code...how to handle select option in function module...

6 REPLIES 6
Read only

athavanraja
Active Contributor
828

declare a tables parameter of type RSELOPTION.

then you can pss range values to this parameter

Raja

Read only

0 Likes
828

Sorry Durairaj, i did't not get you

Read only

0 Likes
828

in the function module import parameter instead of matnr_from , matnr_to just declare one parameter

r_matnr TYPE RSELOPTION .

r_matnr is a itab with files like low, high, sign, option , etc.

so while calling the fm you pass , low, high, sign, option , etc to this parameter

and within fm you do a selection using r_matnr.

select * from .... where matnr in r_matnr.

Regard

Raja

Read only

Former Member
0 Likes
828

Hello,

Declare the Table type<b> MATNR_RAN</b>

Regards,

Vasanth

Read only

Former Member
0 Likes
828

Hi,

Write as below:

data:r_matnr type wselkunnr.

r_matnr_line-sign = 'I'.

r_matnr_line-option = 'BT'.

r_matnr_line-low = matnr_from.

r_matnr_line-high = matnr_to.

APPEND r_matnr.

Regards,

Anji

Read only

Former Member
0 Likes
828

change the declaration to this..

ranges :r_matnr for mseg-matnr.