cancel
Showing results for 
Search instead for 
Did you mean: 

BSP dropdown

Former Member
0 Kudos

Hello friends,

In a BSP, i have added a dropdown in one of the htm pages, but I can't seem to get the selected value in the OnInputProcessing.

In the layout i've added this code:

<hcmlso:section title="Stilling" >

<htmlb:dropdownListBox id="formstilling" tooltip="Stilling" selection="Stilling">

<% loop at lt_tab into w_tab.

<htmlb:listBoxItem key="<%= sy-index %>" value="<%= w_tab-name %>" />

<% endloop. %>

</htmlb:dropdownListBox>

</hcmlso:section>

And in the OnInputProcessing i've added the following:

call method request->get_form_fields

changing

fields = i_fields.

I get all the fields, including "formstilling", but it always contain the value '1'. and not the content selected...

I'm new to BSP and would appreciate any input..

best regards B

Accepted Solutions (1)

Accepted Solutions (1)

former_member188685
Active Contributor
0 Kudos

some thing wrong with the code for population of listbox item. remove sy-index and use sy-tabix. and see how it works.

<hcmlso:section title="Stilling" >
<htmlb:dropdownListBox id="formstilling" tooltip="Stilling" selection="Stilling">
<% loop at lt_tab into w_tab.
<htmlb:listBoxItem key="<%= sy-tabix %>" value="<%= w_tab-name %>" />
<% endloop. %>
</htmlb:dropdownListBox>
</hcmlso:section>

Former Member
0 Kudos

Ok, thank you. that returned the row selected, but how do I get the actual value? Is that possible without reading an internal table using the index of the row?

former_member188685
Active Contributor
0 Kudos
data: O_DATA     TYPE REF TO CL_HTMLB_INPUTFIELD.

   O_DATA ?= CL_HTMLB_MANAGER=>GET_DATA(
                     REQUEST = REQUEST
                     NAME    = 'inputfield'
                     ID      = 'id' ).
      IF O_DATA->VALUE IS not INITIAL.
        L_value = O_data->value. "this is key
      ENDIF.

now read the internal table with the key and get the value.

in your case key is record index, but generally the key will be different than table record index. so read the internal table with key and get the value. in your case you simply use read table index = selectedkey will be enough.

Former Member
0 Kudos

Ok, so it's not possible to get the value selected in the dropdown directly in 'OnInputProcessing'?

I will have to use the index to get the selected line. My only problem with this is that the internal table is only available in the layout.

I could define the internal table in the page attributes, but it seems i cant define 'Type table of' here. So how will I access the internal table?

former_member184111
Active Contributor
0 Kudos

Hi,

You can define TYPE TABLE OF in Type Definitions tab and then use it for TYPING your internal table in Page Attributes.

Regards,

Anubhav.

former_member188685
Active Contributor
0 Kudos

if you are using the Page with flow logic you can use Type Declarations tab , and use the Table type in your page attributes.

if it is controller then you may have to create a tabletype at Dictionary level and use that in the page attributes for creating the internal table.

Former Member
0 Kudos

Ok, it's a flow-logic page and i've defined the table under the types tab.

I fill the internal table in initialization, and the values are available in the layout,

but in 'OnInputProcessing' the table is empty... am I doin something wrong?

Former Member
0 Kudos

maybe I have to send it through the form,

how do I send a table through a form..

I mean fields are sent in this way i think:

<input type="hidden" name="formsignature" value="<%= formsignature%>">

former_member188685
Active Contributor
0 Kudos

that means your application is not statefull. Double click on application and check the checkbox Sateful in the properties screen . and see now.

Former Member
0 Kudos

Thats correct, statefull is not checked. but this is a standard BSP. And i've done changes in z-copy htm's. This means I have to make a copy of the whole BSP application...

maybe it's easier to refill the internal table in the 'OnInputSection'....

former_member188685
Active Contributor
0 Kudos

i think you have to copy the whole application. or else using Cookies capture the table values.

Former Member
0 Kudos

Ok, thank you very much for your time. you have been very helpful:)

best regards B

Answers (0)