on 05-19-2006 10:14 AM
Hello, i´ve got an iterator.
To fill a dropdown box i have to select data from a db.
so far...
i use cookies to get the select-parameters in the iterator but, it says "unknown field: runtime->"
does anybody know a solution ?
Hi Benjamin,
you can use a constructor method where you read your values from DB and finally use them for your dropdown listbox. Here an example:
method constructor.
DATA: m_row_ref TYPE REF TO SFLIGHT,
m_color_ref TYPE REF TO DATA,
entry TYPE IHTTPNVP,
entrytab TYPE TIHTTPNVP.
entry-name = 'key_red'.
entry-value = 'Red'.
append entry to entrytab.
entry-name = 'key_green'.
entry-value = 'Green'.
append entry to entrytab.
entry-name = 'key_blue'.
entry-value = 'Blue'.
append entry to entrytab.
entry-name = 'key_black'.
entry-value = 'Black'.
append entry to entrytab.
get reference of entrytab into m_color_ref.
endmethod. "CONSTRUCTOR
You can also read values from db into your internal table instead.
In your iterator you use:
p_replacement_bee = cl_htmlb_dropdownlistbox=>factory(
id = p_cell_id
selection = 'key_green'
table = me->m_color_ref
nameofkeycolumn = 'NAME'
nameofvaluecolumn = 'VALUE' ).
Regards,
Rainer
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
let me explain by slightly modifying Rainer's code sample.
method constructor.
DATA: m_row_ref TYPE REF TO SFLIGHT,
m_color_ref TYPE REF TO DATA,
entry TYPE IHTTPNVP,
entrytab TYPE TIHTTPNVP.
entry-name = 'key_red'.
concatenate 'Red' '1998' into entry-value separated by '|' .
append entry to entrytab.
entry-name = 'key_green'.
concatenate 'Green' '2000' into entry-value separated by '|' .
append entry to entrytab.
entry-name = 'key_blue'.
concatenate 'Blue' '2003' into entry-value separated by '|' .
append entry to entrytab.
entry-name = 'key_black'.
concatenate 'Black' '2005' into entry-value separated by '|' .
append entry to entrytab.
get reference of entrytab into m_color_ref.
endmethod. "CONSTRUCTOR
Regards
Raja
Hi,
for tableview the sample code is as follows...
<htmlb:tableView id="net200_tv" table="<%= it_flight%>" iterator="<%=iterator%>" selectionMode="LINEEDIT" onRowSelection="my_select" footerVisible="FALSE"/>
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.
Hi Benjamin,
Declare the seleciton parameter say G1, G2 as global parameters of the iterator class, create the constructor of your class with two importing variables say ig1 and ig2. Then while creating iterator pass your selct opitons.
Create object iterator exporting ig1 = s1 ig2 = s2.
In the constructor of iterator give g1 = ig1 g2 = ig2.
Regards,
Arun.
Hi,
Populate the data from database into an internal table and declare that internal table as page attribute and then give that table as attrbite to that dropdownlistbox as shown below....
<htmlb:dropdownListBox id="Matnr"
table="<%= it_mara1%>"
nameOfKeyColumn="Matnr"
nameOfValueColumn="Matnr">
</htmlb:dropdownListBox>
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 |
---|---|
98 | |
11 | |
11 | |
10 | |
10 | |
8 | |
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.