Comments

BSP Dropdown List - create a BSP dropdown list which allows user selection!!




Below is the basic code for allowing users to make a selection form a dropdown list and then click a button to process the selection.

Display dropdown list and retrieve value selected

Layout
------
The code below is pure HTML and not HTMLB so you will need to remove the
htmlb code that SAP insert automatically.

                    <htmlb:content design="design2003">
                    <htmlb:page title = " ">
                    <htmlb:form> 

<html>
<page>
<FORM NAME="formlist">
<table border="0" cellpadding="0" cellspacing="0">
<tr>
    <td align="RIGHT">
        <INPUT TYPE="TEXT" NAME="keywords" size=60>
        <INPUT type="submit" name="OnInputProcessing(search)">
    </td>
<% data: it_ekko type standard table of ekko initial size 0,
         wa_ekko type ekko.

     select ebeln
      up to 10 rows
       from ekko
       into table it_ekko.
%>

    <td><SELECT NAME="typelist">
        <% loop at it_ekko into wa_ekko. %>
        <OPTION VALUE="<%=sy-tabix%>"><%=wa_ekko-ebeln%> </OPTION>
        <% endloop. %>
        </SELECT>
    </td>



</tr></table>
</FORM>
</page>
</html>

OnInputProcessing
-----------------
case event_id.   "declared in page attributes as type STRING
  when 'search'.
*   Sets value of parameter, i.e. gets value from screen
    navigation->set_parameter( name  = 'keywords' ).

*   Gets value of parameter, so can be moved into abap field
*   Note: gd_keywords declared in page attributes as type string
    gd_keywords = navigation->get_parameter( name = 'keywords' ).

*   set and get user option, gd_option(type string) will contain index
*   of line selected
    navigation->set_parameter( name  = 'typelist' ).
    gd_option = navigation->get_parameter( name = 'typelist' ).

*   If you create page 'courses.htm' with a field called keywords within
*   page attributes then the value entered in this page will be passed
*   through.
    navigation->goto_page('courses.htm').
endcase.






sapdev logo background
sapdev logo sapdev logo


Can't find something on ERPWorkbench? A quick search should fix that: