on 02-27-2007 10:02 AM
Hi all,
I have a requirement in which i am having a dropdown which shows entries with values from a table. Then when i select any entry and save it should be saved in the database table. <b>Then i should be able to see the saved value in the dropdown field every time i execute the program again, though i should be able to change it by again selecting any other value.</b>
I do not know how to show the saved value in dropdown.
I am using iterator to display dropdown with following code:
<i>WHEN 'CATEGORY'.
DATA: I_PHAS1_REF TYPE REF TO DATA.
CLASS CL_HTMLB_MANAGER DEFINITION LOAD.
DATA : l_event TYPE REF TO CL_HTMLB_EVENT.
GET REFERENCE OF me->it_category INTO I_PHAS1_REF.
p_replacement_bee = CL_HTMLB_DROPDOWNLISTBOX=>FACTORY( ID = P_CELL_ID
TABLE = I_PHAS1_REF
NAMEOFKEYCOLUMN = 'CATEGORY'
NAMEOFVALUECOLUMN = 'CATEGORY').</i>
Here it_category is the internal table.
Any pointers will be of great help. Plz post the code if possible.
Regards,
Rohit Khetarpal
Hi,
same problem I had some times ago. Here's my solution:
Say, your table IT_CATEGORY / I_PHAS1_REF has 2 entries in the field CATEGORY.
First entry is '0001', second entry is '0002'.
WHEN 'CATEGORY'.
DATA: I_PHAS1_REF TYPE REF TO DATA.
DATA: lv_value TYPE string.
GET REFERENCE OF me->it_category INTO I_PHAS1_REF.
lv_value = '0002'. "Here you can fill the value by reading the database table
p_replacement_bee = cl_htmlb_dropdownlistbox=>factory(
id = p_cell_id
nameofkeycolumn = 'CATEGORY'
nameofvaluecolumn = 'CATEGORY'
selection = lv_value "this is the important one!
width = '100%'
table = I_PHAS1_REF ).
In the event handling, you can read the dropdownlistbox like any other inputfield of the tableview or you use the parameter "ONSELECT" of the factory-method of cl_htmlb_dropdownlistbox.
Hope I could help you.
Regards
Claudia
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
84 | |
23 | |
11 | |
9 | |
8 | |
5 | |
5 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.