Skip to Content
author's profile photo Former Member
Former Member

Using tableview to accept Input

Hi,

Are these 2 things possible in BSP tableview - Using tableview to accept user inputs and adding new empty rows dynamically to the tableview? My requirement is as follows:

1. My client wants that I should have a tableview with Inputfields & dropdownboxes in which the user can enter & save values in the database.

2.Initially the tableview should have 1 empty row for input & as the user enters some value in it a new row should be added to the tableview for the next entry.

If anyone has done this please help me out.

Regards

Tejaswini

Add a comment
10|10000 characters needed characters exceeded

Related questions

6 Answers

  • author's profile photo Former Member
    Former Member
    Posted on Jan 06, 2005 at 01:49 PM

    Hi Naresh,

    Yes I am modifying my internal table with the values from the tableview. Everytime a new row is added I want to display the existing internal table values in the table view and also give the user a new row for input. But the previous values are getting lost and the tableview is displayed with empty rows alongwith a new row for input.

    My code for onInputProcessing() is as follows:

    DATA temp LIKE LINE OF tab1.

    CASE event->name.

    WHEN 'button'.

    case event->id.

    when 'ADD'.

    temp-zr8klpaya = table_event->get_cell_value(

    row_index = table_event->selectedrowindex

    column_index = '2' ).

    temp-zr8klgoaq = table_event->get_cell_value (

    row_index = table_event->selectedrowindex

    column_index = '3' ).

    IF temp IS NOT INITIAL.

    APPEND temp TO tab1.

    ENDIF.

    endcase.

    Can you explain to me what your requirement was and how you have developed the logic for it?

    Regards

    Tejaswini

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member

      Hi Tejaswini

      Check few following things

      1. whether get_cell_value is returning the value in the variable

      2. whthere your internal table is getting updated

      My code is like this

      tlist ?= cl_htmlb_manager=>get_data(

      request = runtime->server->request

      name = 'tableView'

      id = 'zaddress' ).

      IF tlist IS NOT INITIAL.

      DATA: tlist_data TYPE REF TO cl_htmlb_event_tableview.

      tlist_data = tlist->data.

      IF tlist_data->prevselectedrowindex IS NOT INITIAL.

      DATA: rowlist LIKE LINE OF intaddress.

      FIELD-SYMBOLS: <row> LIKE LINE OF intaddress.

      TRY.

      CALL METHOD tlist_data->get_simple_data

      EXPORTING

      row_idx = tlist_data->prevselectedrowindex

      col_name = 'DEPARTURE'

      CHANGING

      data = rowlist-departure.

      CATCH cx_sy_conversion_error .

      ENDTRY.

      TRY.

      CALL METHOD tlist_data->get_simple_data

      EXPORTING

      row_idx = tlist_data->prevselectedrowindex

      col_name = 'ZDATE'

      CHANGING

      data = rowlist-zdate.

      CATCH cx_sy_conversion_error .

      ENDTRY.

      append rowlist to intaddress.

      becoz i tried with get_cell_value but it was not working for me. thats why i used get_simple_data.

      Hope this will solve your problem

      Regards

      Naresh

  • author's profile photo Former Member
    Former Member
    Posted on Jan 03, 2005 at 12:33 PM

    Hi

    You can edit the lines in table view using table view iterators.For details of iterators you can see the following weblog by Brian

    /people/brian.mckellar/blog/2003/10/31/bsp-programming-htmlb-tableview-iterator

    i have also done the same thing in of the requirement by giving empty rows in table.

    actually i ahve appened few blank rows in the table in onCreate event.

    Hope it will help you.

    regards

    Naresh

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jan 04, 2005 at 08:36 AM

    Hi Naresh,

    Thanks for the suggestions,I will try them out.

    How do you append new lines to the tableview at runtime?Suppose the user enters values in the first empty row I need to generate another empty row so that he can enter further data.

    Regards

    Tejaswini

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member

      Hi

      You can append empty row in the internal table , which you r using for tableview .

      you need a event to generate a empty row.you can put a button to appebnd row or something like this.

      Regards

      Naresh

  • author's profile photo Former Member
    Former Member
    Posted on Jan 05, 2005 at 10:52 AM

    Hi,

    I went through the weblogs & I am now using tableview iterator to add new rows to my internal table on click of a button that is present in the tableview. But I am facing a new problem. I want the data that I have input in the previous rows to appear in the tableview. But I am getting empty rows. How do I assign the values of the internal table to the tableview? This is how I am doing it now.

    <htmlb:tableView id = "tv1"

    table = "<%= tab1 %>"

    allRowsEditable = "TRUE"

    selectionMode = "LINEEDIT"

    selectedRowIndex = "<%= index %>"

    iterator = "<%= iterator %>" >

    </htmlb:tableView>

    When I am checking in onInputProcessing the tab1 has values that I enter in it.But it does not appear inn the tableview. Please help I am unable to think what else is to be done.

    Regards

    Tejaswini

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jan 11, 2005 at 09:50 AM

    Hi Naresh,

    Thanks a lot. Now my iterator is working fine. In RENDER_CELL_START I am fetching the P_ROW_DATA_REF and displaying the values for each cell that is being rendered.

    Your inputs have been a great help.

    Regards

    Tejaswini

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Jan 23, 2005 at 08:51 PM

    Two minor remarks:

    (1) "APPEND INITIAL LINE TO itab." is the fastest way to empty lines in the table.

    (2) In terms of debugging, sometimes you can not debug into our classes, as they have the system flag set. Look in the menu of debugger, and just activate system debugging to debug through all of our code as well.

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.