on 10-17-2007 3:51 PM
Hi,
I wolud like to know how to use dropdwn list using iterators.
When i select a perticular in a table, the column of the table should act like a dropdwn list.
How to fill the dropdwn. wer v need to write the code for that...
Thanks in advance
Venkat
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Venkat,
Try these two blogs to get a clear understanding of the Iterator concepts...
1) <a href="/people/brian.mckellar/blog/2003/10/31/bsp-programming-htmlb-tableview-iterator Basics : By Brian</a>
2) <a href="/people/thomas.jung3/blog/2004/09/15/bsp-150-a-developer146s-journal-part-xi--table-view-iterators Advanced : By Thomas</a>
Then you should understand what Raja has posted in the earlier thread....
Hope this helps.
<b><i>Do reward each useful answer..!</i></b>
Thanks,
Tatvagna.
i am sssuming you know how to create simple texts in the Iterators.
To create DDLBs in iterators refer to sample code mentioned below.
build your table fields in method GET_COLUMN_DEFINITIONS.
method GET_COLUMN_VALUE is defined as below.
method get_column_value .
*COLUMN_NAME Importing Type ANY
*COLUMN_VALUE Returning Type STRING
data: lr_descrref type ref to cl_abap_typedescr,
l_char(256) type c.
field-symbols: <row> type any, <col> type any.
assign row_ref->* to <row>.
assign component column_name of structure <row> to <col>.
lr_descrref = cl_abap_typedescr=>describe_by_data( <col> ).
if lr_descrref->type_kind = 'P'.
write <col> to l_char decimals 2.
else.
write <col> to l_char.
endif.
shift l_char left deleting leading space.
column_value = l_char.
endmethod.
METHOD if_htmlb_tableview_iterator~render_cell_start .
DATA: lo_text TYPE REF TO cl_htmlb_textview,
lo_ddlb TYPE REF TO cl_htmlb_dropdownlistbox.
FIELD-SYMBOLS: <dat> TYPE ANY.
row_ref = p_row_data_ref.
CASE p_column_key.
WHEN 'SORT_NUM'.
CREATE OBJECT lo_ddlb.
GET REFERENCE OF lt_seq_no INTO lo_ddlb->table.
lo_ddlb->id = p_cell_id.
lo_ddlb->nameofkeycolumn = 'ENTRY_KEY'.
lo_ddlb->nameofvaluecolumn = 'ENTRY_VALUE'.
lo_ddlb->selection = get_column_value( p_column_key ).
p_replacement_bee = lo_ddlb.
WHEN OTHERS.
CREATE OBJECT lo_text.
lo_text->id = p_cell_id.
lo_text->wrapping = 'FALSE'.
lo_text->text = get_column_value( p_column_key ).
lo_text->design = 'STANDARD'.
p_replacement_bee = lo_text.
ENDCASE.
ENDMETHOD.
hope this helps.
User | Count |
---|---|
93 | |
10 | |
10 | |
9 | |
9 | |
7 | |
6 | |
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.