cancel
Showing results for 
Search instead for 
Did you mean: 

passing values to FM froma selection screen

Former Member
0 Kudos

Hi Guys,

I have a selection screen in which i have 'From' and 'To' input fields.Also using multiple select button i can select discrete values.In the function module they have a table type in the import param.

Is it possible to send the values within the range plus the discrete values selected? If yes, then please help.

Thanks,

tubai.

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi,

You can below code:

DATA: rt_ranges TYPE REF TO data.

FIELD-SYMBOLS: <fs_select> TYPE table,

<fs_wa> TYPE ANY,

<fs_wa1> TYPE ANY.

DATA: lt_select TYPE TABLE OF rsdsselopt,

wa_sel_opt TYPE rsdsselopt.

  • Retrieve the data from the select option

rt_ranges = wd_this->w_handler->get_range_table_of_sel_field(

i_id = 'SELECT' ).

  • Assign it to a field symbol

ASSIGN rt_ranges->* TO <fs_select>.

IF NOT <fs_select> IS INITIAL.

LOOP AT <fs_select> ASSIGNING <fs_wa>.

ASSIGN COMPONENT 'SIGN' OF STRUCTURE <fs_wa> TO <fs_wa1>.

lwa_sel_opt-sign = <fs_wa1>.

ASSIGN COMPONENT 'OPTION' OF STRUCTURE <fs_wa> TO <fs_wa1>.

lwa_sel_opt-option = <fs_wa1>.

ASSIGN COMPONENT 'LOW' OF STRUCTURE <fs_wa> TO <fs_wa1>.

lwa_sel_opt-low = <fs_wa1>.

ASSIGN COMPONENT 'HIGH' OF STRUCTURE <fs_wa> TO <fs_wa1>.

lwa_sel_opt-high = <fs_wa1>.

APPEND lwa_sel_opt TO lt_select.

ENDLOOP.

ENDIF.

You then pass lt_select to your FM.

Regards,

Priya