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

Multiple value parameter....

Former Member
0 Likes
835

Hi All,

I developed a Function Module where I have to pass a parameter with mulitple values.....similar to the one we use in Data Browser (SE16) for multiple values.

For example,

I want to select records from a table depending on the document type of the record.

The user will pass the document types which can be one type or two or any number of types.If its two then the FM should return all the records with those Document types.

The document types and the number of Document types to be passed are dynamic and are not consistent.

Help me to achieve this.

Thanks in advance.

Daniel.

6 REPLIES 6
Read only

Former Member
0 Likes
687

Hi daniel,

There are tow ways,

Either declare it as of table type and pass the table to the FM.

Or declare it of select option type and pass that to FM.

Regards,

Atish

Read only

0 Likes
687

I tried that too.there are two problems in it,

(1) In Function Module I am not able to declare Select-Options

(2) Even if possible select options takes only continuous multiple values i.e. as a range between From value and To value.But i want to pass discrete values.

When I pass a table as a parameter to where clause,I get a error message that only table with range or select option structure can be used in where clause with "IN" in it.

Read only

0 Likes
687

Hi,

For which field you want select-option. There are lots of structure of type select option. If you can tell me field I can tell you if one availble.

For eg see ROIO_SEL

regards,

Atish

Read only

0 Likes
687

You just need to pass the parameter of type ROIO_T_SEL.

Regards,

Atish

Read only

0 Likes
687

hi daniel,

Select-options takes discrete values. U can specify range or even enter different values and then use IN clause in the where condition.

example :

Data : w_werks type marc-werks.

select-options : s_werks for w_werks.

s_werks-sign = c_i.

s_werks-option = c_eq.

s_werks-low = c_1017.

APPEND s_werks.

s_werks-low = c_1051.

APPEND s_werks.

s_werks-low = c_1018.

APPEND s_werks.

s_werks-low = c_1019.

APPEND s_werks.

s_werks-low = c_1070.

APPEND s_werks.

CLEAR s_werks.

See in this example, we are passing different plant values to select-options.

Then u can use,

SELECT * FROM marc WHERE werks IN s_werks.

<REMOVED BY MODERATOR>

Harimanjesh AN

Edited by: Alvaro Tejada Galindo on Feb 22, 2008 4:23 PM

Read only

Former Member
0 Likes
687

Thanks. I am closing this thread