cancel
Showing results for 
Search instead for 
Did you mean: 

Iterator Doubt

Former Member
0 Kudos

Hi Experts,

Please see my previous Question,

From the above forum I folowed the code giveb By Raja, But I got this error.

Where can declare <b>m_currencies</b> and based on which structure?

The Comple code from Raja is Below,

To Fill the M_CURRENCIES_REF:

IF_HTMLB_TABLEVIEW_ITERATOR~GET_COLUMN_DEFINITIONS.

  FIELD-SYMBOLS: <currency> TYPE IHTTPNVP.
  CLEAR me->m_currencies.
  APPEND INITIAL LINE TO me->m_currencies ASSIGNING <currency>.
  <currency>-NAME = 'USD'. <currency>-value = 'US Dollar'.
  APPEND INITIAL LINE TO me->m_currencies ASSIGNING <currency>.
  <currency>-NAME = 'EUR'. <currency>-value = 'Euro'.
  APPEND INITIAL LINE TO me->m_currencies ASSIGNING <currency>.
  <currency>-NAME = 'ZAR'. <currency>-value = 'SA Rand'.
  GET REFERENCE OF me->m_currencies INTO me->m_currencies_ref.

Thanks In Advance,

Points Assured for all suggestions.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

You have to declare a table type eg: gt_currencies type IHTTPNVP in the attributes of the iterarot class.

in the constructor of the class populate the table gt_currencies.

in the method RENDER_CELL_START

METHOD if_htmlb_tableview_iterator~render_cell_start .
  DATA:  lo_ddlb     TYPE REF TO cl_htmlb_dropdownlistbox
             lo_text     TYPE REF TO cl_htmlb_textview.

  FIELD-SYMBOLS: <dat> TYPE ANY.

  row_ref = p_row_data_ref.

  CASE p_column_key.

    WHEN 'CURRENCY'.
      CREATE OBJECT lo_ddlb.
      GET REFERENCE  OF gt_currencies 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.

Note: in the method GET_COLUMN_DEFINITIONS you just define the cou,ns which you want to display int he table view.

Hope this helps.

Cheers

Amandeep

<i><b>Reward points for each helpful answer</b></i>

Answers (0)