Skip to Content

Retrieve edited tableview in OnInputProcessing

Hi,

Is there a tutorial or an example on how to retrieve the edited contents of a tableview in the OnInputProcessing event? I have a table which is a mixture of checkboxes and input fields, and would like to retrieve the contents after the user has made modifications.

Using the CL_HTNLB_MANAGER=>get_data method I can retrieve the tableview. Then, I can find the edited contents of the fields by creating a loop with my_tv_data->get_cell_value. However, I have to dynamically construct the field names, and keep track of columns and rows...

I'd like to retrieve the modified table contents straight back into the same internal table I used for the tableview display in the first place. Is there a simple way of doing this?

Trond

Add comment
10|10000 characters needed characters exceeded

  • Follow
  • Get RSS Feed

2 Answers

  • Mar 08, 2004 at 12:08 PM

    I'll try posting a reply to myself just to see my topic at the top of the list...

    In short, does anyone know how to easily retrieve the edited contents of a tableview in OnInputProcessing?

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member

      Hi Trond,

      > I'll try posting a reply to myself just to see my topic at the top of the list...

      I did the same with one of my topics 😉

      It didn't find a solution either where the modified data is automatically transfered to the underlying table...

      Here is my solution for your problem:

      DATA: lh_data TYPE REF TO CL_HTMLB_TABLEVIEW,

      lh_event TYPE REF TO CL_HTMLB_EVENT_TABLEVIEW,

      ls_entry LIKE LINE OF mh_model_create->mt_node_data.

      • get request data from htmlb manager

      lh_data ?= CL_HTMLB_MANAGER=>GET_DATA(

      request = runtime->server->request

      name = 'tableview'

      id = 'create_table' ).

      lh_event ?= lh_data->data.

      • mh_model has two attribute:

      • mt_node_data: table used for the tableview

      • mh_entry_count: nr of entries (lines in the table)

      • loop over all entries

      DO mh_model->m_entry_count TIMES.

      • read the modified data of the second column

      ls_entry-value = lh_event->GET_CELL_VALUE(

      row_index = sy-index

      column_index = 2 ).

      • ...read the data of other columns if you want

      • modify the data in the table

      MODIFY mh_model->mt_node_data FROM ls_entry

      INDEX sy-index TRANSPORTING value.

      ENDDO.

      Don't know if this is easier as your approach...

      Best regards, Thomas

  • avatar image
    Former Member
    Apr 06, 2004 at 08:40 PM

    Hello,

    I am trying to go the same thing but still no luck. At the moment I am looking into the table attribute of the CL_HTMLB_TABLEVIEW class. I see this filled with the structure of my itab when the tableview is being created but on the postback when I try to retrieve what has changed this is blank.

    I am now experimenting with recreating my itab with the changed value similar to Thomas Koch post but trying to use field symbols so I can dynamically do this for other itabs.

    I wonder of other solutions to this topic or a recommended way.

    Matt

    Add comment
    10|10000 characters needed characters exceeded