cancel
Showing results for 
Search instead for 
Did you mean: 

Tableview with multilineedit. How to read values from cells.

Former Member
0 Kudos

Hi there,

I'm trying to create an application where the users can change / enter values in specific columns of a tableview - control. (HTMLB with ABAP).

I've encountered the following problem:

When the event "onRowSelection" is fired from the tableview, I process the tableview in "OnInputProcessing" to rescue the entered data into an internal table (which is the table used for the tableview).

The coding looks like this and works without any problem:


  IF event->name = 'tableView'.

    table_event ?= event.

    LOOP AT table_event->prevselectedrowindextable INTO line.
      READ TABLE itab INDEX line INTO wa_itab.
      input = table_event->get_cell_value( row_index = line
                                     column_index = 9 ).
      MOVE input TO wa_itab-inspk.
      MODIFY itab FROM wa_itab INDEX line.
    ENDLOOP.

  ENDIF.

This works perfect.

But when the user is ready with editing the data, he should be able to press a button on the page and the selected rows should be read a last time.

So I made the following coding "OnInputProcessing" when the button is pressed:


  IF event->name = 'button'.

    tv ?= cl_htmlb_manager=>get_data(
             request = runtime->server->request
             name    = 'tableView'
             id      = 'tableView1' ).
    table ?= tv->data.

    LOOP AT table->prevselectedrowindextable INTO line.
      READ TABLE itab INDEX line INTO wa_itab.
      input = table->get_cell_value( row_index = line
                                     column_index = 9 ).
      MOVE input TO wa_itab-inspk.
      MODIFY itab FROM wa_itab INDEX line.
    ENDLOOP.
  ENDIF.

But this time the table->get_cell_value methode is always empty. The prevselectedrowindextable contains the correct selected rows.

I think it's because the event wasn't fired by the tableview itself. But I don't know what I can do to get the actual edited values out of the tableview-cells.

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi Gerhard,

I am having a similar problem. The links above contain plenty of good information but I am still unclear on how to get the data when the event is fired by, say, a separate button. How did you ever resolve this?

Former Member
0 Kudos

This should really be posted and discussed in the BSP Forum.

Check out this weblog series for more information:

<a href="/people/sap.user72/blog/2004/09/07/bsp-howto-exploring-bsp-development-and-the-miniwas-620 BSP</a> or <a href="/people/sap.user72/blog/2005/03/29/bsp-howto-exploring-bsp-development-with-mvc

athavanraja
Active Contributor
0 Kudos

Hi,

check out BSP weblogs at

https://www.sdn.sap.com/sdn/weblogs.sdn?blog=/weblogs/topic/24

and also the BSP forum at

Regards

Raja