cancel
Showing results for 
Search instead for 
Did you mean: 

SIngle and list box elment in select option screen

Former Member
0 Kudos

Hi

I ahve situation in which i am adding sleection field but in some case i wanted to have single selection insteadof range in which i can pass single value how can i do it. and is it possbile for me to display listbox in selection options screen thru coding pls do let me know .

*

l_ref_cmp_usage1 = wd_This->wd_CpUse_Select_Options( ).

if l_ref_cmp_usage1->has_active_component( ) is initial.

l_ref_cmp_usage1->create_component( ).

endif.

*

l_ref_INTERFACECONTROLLER1 = wd_This->wd_CpIfc_Select_Options( ).

l_R_HELPER_CLASS = l_ref_INTERFACECONTROLLER1->Init_Selection_Screen( ).

*

*data typname type string.

*typname = 'Z_CONTRATO_NR'.

  • Creating Range Table for Contrato Number.

CALL METHOD L_R_HELPER_CLASS->CREATE_RANGE_TABLE

EXPORTING

I_TYPENAME = 'Z_CONTRATO_NR'

  • I_LENGTH =

  • I_DECIMALS =

RECEIVING

RT_RANGE_TABLE = lt_range_data.

*

CALL METHOD L_R_HELPER_CLASS->ADD_SELECTION_FIELD

EXPORTING

I_ID = 'Z_CONTRATO_NR'

  • I_WITHIN_BLOCK = MC_ID_MAIN_BLOCK

  • I_DESCRIPTION =

  • I_IS_AUTO_DESCRIPTION = ABAP_TRUE

IT_RESULT = lt_range_data

I_READ_ONLY = ABAP_FALSE.

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi Dhiraj.

You can achieve single selection by adding the parameter i_no_intervals = abap_true to the method call:


wd_this->mr_selop->add_selection_field(
                         i_id = lv_fieldname
                         i_no_intervals = abap_true
                         i_no_extension = abap_true
                         i_obligatory = abap_true
                         i_read_only = abap_true
                         it_result = lt_range
                         i_value_help_mode = lv_helpmode ).

Hope this helps.

Cheers,

Sascha

Former Member
0 Kudos

Hi Sascha

I had one more related to this which i mentioned with the above message.

As can we add dropdown list to selection is it possible through coding to use drop down list how ?

Regards

Dhiraj

Madhu2004
Active Contributor
0 Kudos

Hai Dhiraj

You can use dropdown list by using the UI element DropDownByKey.

Define a method to populate the values in the dropdown and call it as follows

the doinit method: <b> wd_this->method_name</b>.

<b><u>And the sample code to paopulte the dropdown by key is as follows:</u></b>:

data:

node_flight type ref to if_wd_context_node,

elem_flight type ref to if_wd_context_element,

stru_flight type if_inputview=>element_flight,

nodeinfo_flight type ref to if_wd_context_node_info,

it_valueset type table of wdr_context_attr_value,

it_scarr type table of scarr,

wa_scarr like line of it_scarr,

wa_valueset like line of it_valueset.

  • navigate from <CONTEXT> to <FLIGHT> via lead selection

node_flight = wd_context->get_child_node( name = if_inputview=>wdctx_flight ).

nodeinfo_flight = node_flight->get_node_info( ).

call method cl_abapwd_flight_model=>get_airlines

receiving

l_scarr = it_scarr

.

loop at it_scarr into wa_scarr.

wa_valueset-value = wa_scarr-carrid.

wa_valueset-text = wa_scarr-url.

append wa_valueset to it_valueset.

endloop.

nodeinfo_flight->set_attribute_value_set(

name = 'CARRID'

value_set = it_valueset ).

Former Member
0 Kudos

Hi Dhiraj.

The method add_selection_fields has the the parameters:

I_AS_DROPDOWN Importing Type WDY_BOOLEAN

IT_VALUE_SET Importing Type WDY_KEY_VALUE_TABLE

Use wdy_key_value_table to set the key - values pairs and set i_as_dropdown to true.

Cheers,

Sascha

Former Member
0 Kudos

Hi Sasha,

CALL METHOD L_R_HELPER_CLASS->ADD_SELECTION_FIELDS

EXPORTING

IT_FIELDS =

.

I am getting the add sleection method in this type. How to get the parameters which is specified by you,

Regards

Dhiraj

Former Member
0 Kudos

Hi Sasha,

I got it what you were telling was exactly right.

Will giving points as soon as the issue get sort out.

Thanks & Regards

Dhiraj

Former Member
0 Kudos

Hi Dhiraj.

Please also mark this thread as answered.

Cheers,

Sascha

Former Member
0 Kudos

Hi Sasha,

If in ADD_SELECTION_FIELD method the interval is set to no interval that means only single value is passed.So in th case i dont have to create a range table

instead can u suggest in which we shld pass the result and hotto get the value.

Shld i raise another thread for this query

Message was edited by:

Dhiraj Shetty

Former Member
0 Kudos

Hi Dhiraj.

You can still pass a range table. The range contains the option EQ instead BT if

you set no intervalls.

If you want to use parameters you have to have SP 12 (I Guess).

Cheers,

Sascha

Former Member
0 Kudos

Hi sasha,

I have done the same thing as told by you as enabling the dropbox but i am not getting interval in dropbox for tht when i set the interval value to true also then also its not changing

Regards

Dhiraj

Former Member
0 Kudos

Hi Dhiraj.

In addition to what has been said earlier regarding the single element, if your requirement is to add STRICTLY a parameter, see note 1033992.

This feature has been added recently.

Regards.

Shishir

Former Member
0 Kudos

Hi Dhiraj.

Looks like you can not use intervalls for dropdown box. The init method of the

select_options component only creates one drop down box per selection field.

But I am still on SP09 and I do not know what is possible in higher SPs.

Cheers,

Sascha

Former Member
0 Kudos