on 03-20-2007 7:43 AM
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.
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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 ).
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
Hi,
Go through the link,
http://help.sap.com/saphelp_nw2004s/helpdata/en/d7/ef8841e3af1609e10000000a155106/content.htm
Regards,
Azaz Ali.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
101 | |
13 | |
13 | |
11 | |
11 | |
7 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.