cancel
Showing results for 
Search instead for 
Did you mean: 

DropDown in iterators

former_member1193316
Participant
0 Kudos

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

Accepted Solutions (1)

Accepted Solutions (1)

raja_thangamani
Active Contributor
0 Kudos

Look at the step by step procedure in below link (in my reply)

<b>*Reward each useful answer</b>

Raja T

former_member1193316
Participant
0 Kudos

I need some more clear info. Could you guide me....

Former Member
0 Kudos

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.

former_member1193316
Participant
0 Kudos

Hi Shah,

Wat u send dat was fine. But colud you please provide me some standard examples. so that it would be very easy for me to understand well.

thanks in advance

Former Member
0 Kudos

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.

Answers (0)