Skip to Content
0
Former Member
Dec 15, 2006 at 01:35 PM

Getting default (first)-value of a BSP-dropdownlistbox without selecting it

87 Views

On a MVC/BSP-page I have a dropdown-listbox and a button. I want to select a value from the listbox and press the button to create an object. That works fine.

But in some cases, I want to take the first (default) value of the listbox without selecting (that would be 2 Klicks)it. How can I get this value (without klicking) in the DO_EVENT_HANDLER ?

BSP:

<%

  • The following dropdown-Box only if 'BID'.

if drpdwn_flag = 1. %>

<% lr_fieldutil->set_field( iv_name = 'bid_type'

iv_data = ' ' ). %>

<td>

<htmlb:label for="<%=lr_fieldutil->get_id( )%>" id="bid_type_lb" text="Select a Template"/>

<htmlb:dropdownListBox id="<%=lr_fieldutil->get_id( )%>" nameOfKeyColumn="KEY" nameOfValueColumn="VALUE" table="<%=lt_template_types%>" selection="<%=controller->z_template_id%>" onSelect="templatetypesel" width="170px"/>

</td>

<% endif. %>

</tr>

<tr>

<td>

<htmlb:button id="CreateBIDINV"

onClick="CreateBIDINV"

text="<%= otr(development_projects_ui_bsp/create_bid) %>"

tooltip="Create bid invitation"/>

</td>

</tr>

-


DO_HANDLE_EVENT:

Dropdown-listbox:

IF htmlb_event_ex->event_name EQ cl_dpr_bsp_co=>sc_tn_dropdownlistbox.

lr_event_sel ?= htmlb_event_ex.

CASE htmlb_event_ex->event_server_name.

WHEN 'templatetypesel'.

me-><b>Z_TEMPLATE_ID</b> = lr_event_sel->selection. <= with value

mv_changed = cl_dpr_co=>sc_true.

…..

Button:

…..

ELSEIF htmlb_event_ex->event_server_name EQ 'CreateBIDINV'.

call Function 'Z_BID_CREATE_WITH_TEMPLATE'

destination RFCDESTINATION

exporting

uname = sy-uname

CPROJECT_ID = es_project_ext-project_id

CATEGORY_ID = es_project_ext-extended_attributes-category_id

TEMPLATE_OBJECT_ID = <b>z_template_id</b> <= without value

importing

OBJECT_ID = bidinv_no.

Thanks a lot for the help.