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

how to pass a SELECT-OPTION to a FUNCTION-MODULE

Former Member
0 Likes
2,786

Hi forum:

How can i pass a selection-option like an input parameter of a function-module?. Put one example in the answer, please.

After pass this value i want to put this into an IN select condition.

But for i only need know how to pass this value

thnks

Josué

Thnks

Josue Cruz

1 ACCEPTED SOLUTION
Read only

RichHeilman
Developer Advocate
Developer Advocate
0 Likes
1,377

What is the field in which you want to pass a select-option(range) of? There may be some standard structures and table types that we can use. Otherwise you can create your own in the dictionary and use them in the function module.

If known exits, then you need to create a structure which has the struction of a selection options, including the fields SIGN OPTION LOW HIGH, then you can make a table type of it and use it in the EXPORTING paramters of your functino module, or you can use the structure in the TABLES parameter of the funciton module.

So let me know the actually field that you want to pass as selection option.

I need to know the data type and length.

Regards,

Rich Heilman

7 REPLIES 7
Read only

Former Member
0 Likes
1,377

create structure like select-option in se11 ,use that structure in se37 ,so this would be easy method.

Read only

RichHeilman
Developer Advocate
Developer Advocate
0 Likes
1,378

What is the field in which you want to pass a select-option(range) of? There may be some standard structures and table types that we can use. Otherwise you can create your own in the dictionary and use them in the function module.

If known exits, then you need to create a structure which has the struction of a selection options, including the fields SIGN OPTION LOW HIGH, then you can make a table type of it and use it in the EXPORTING paramters of your functino module, or you can use the structure in the TABLES parameter of the funciton module.

So let me know the actually field that you want to pass as selection option.

I need to know the data type and length.

Regards,

Rich Heilman

Read only

0 Likes
1,377

Hi Rich, pleas put an example

Thnks

Josué

Read only

0 Likes
1,377

Can you tell me the field that you want to pass as select option? Like is it for, say, MATNR?

PS, you will not be handling this using code, but you will be using dictionary objects, structures, and maybe a table type.

Regards,

Rich Heilman

Read only

0 Likes
1,377

Hi Rich.

this is a little example of my code.

DATA: wa_bukrs TYPE bkpf-bukrs,

wa_budat TYPE bkpf-budat,

wa_gjahr TYPE bkpf-gjahr.

SELECT-OPTIONS: se_bukrs FOR wa_bukrs OBLIGATORY,

se_gjahr FOR wa_gjahr OBLIGATORY,

se_budat FOR wa_budat OBLIGATORY.

HERE i can to put the call to the function.

Thnks

Read only

0 Likes
1,377

You want to pass all three of these select options?

Regards,

Rich Heilman

Read only

0 Likes
1,377

Ok, so you can start by creating your structure in the ABAP dictionary, define 4 fields, SIGN, OPTION, LOW and HIGH. SIGN should be character with length 1, OPTION should be character length 2, LOW and HIGH should be the same type as your select-option fields, for example, the first one BUKRS, it should be typed like this field. Now that you have your structure, you can now use it in the definition of your funciton module in the TABLES tab, now all you need to do is pass the select-option to your function call via this new TABLES parameter.

Thats really it.

Regards,

RIch Heilman