cancel
Showing results for 
Search instead for 
Did you mean: 

IF_WD_SELECT_OPTIONS / dropdown box / how to get the selected field

Former Member
0 Kudos

Hello,

I am using a dropdownbox as a selection criteria.

The box is filled via value_set.

So far no problem.

I would like to act on the field content the user has selected from the dropwdown box.

Question: What is the code behind to get that value here ?

My code to add the box:

select * from /BI0/PPROFIT_CTR into table it_pc

where co_area = '0001' and

objvers = 'A'

and G_CWW009 <> ' '.

refresh lt_value_set.

LOOP at it_pc into is_pc.

concatenate is_pc-G_CWW009 '__' is_pc-profit_ctr

into value_set-value.

concatenate is_pc-G_CWW009 is_pc-profit_ctr

into value_set-key.

insert value_set into table lt_value_set.

endloop.

wd_this->m_handler->add_parameter_field(

i_description = 'Profit Center'

i_id = 'ZPROC'

i_value = lr_value

i_as_dropdown = abap_true

it_value_set = lt_value_set

I_OBLIGATORY = 'X'

i_within_block = 'GROUP' ).

Many thanks

Paul

Edited by: Paul Boxberg on Jun 28, 2009 1:24 PM

Accepted Solutions (0)

Answers (1)

Answers (1)

abhimanyu_lagishetti7
Active Contributor
0 Kudos

lr_value must be type ref to data.

Use the method GET_SELECTION_FIELD supply the I_ID as ZPROC get the ET_RESULT into lr_value which is type ref to data.

declare a range table of type of your selection screen field.

field-symbols: <lt_range> type range of <type of your selection screen field>,

<ls_range> like line of <lt_raneg>.

assign lr_value->* to <lt_range>.

loop at <lt_range> assigning <ls_range>.

  • <ls_range>-low will have the value selected in dropdown

endloop.