Skip to Content

Inputfield in a tableview: .... where are my entered values??!!

I am on the way to write a BSP for an online store. I created a table with some articles (materialno., text, quantity and an "add to basket"-button).

The quantity is defined as an inputfield. In the OnInputProcessing event I try to get the value of the input and as well the number of the selected material. But the fields are always empty...

Here the code:


<%@page language="ABAP" %>

<%@extension name="htmlb" prefix="htmlb" %>


<htmlb:tableView id = "tvX"

headerText = "Materials"

headerVisible = "true"

design = "alternating"

visibleRowCount = "10"

fillUpEmptyRows = "true"

onHeaderClick = "MyEventHeaderClick"

onRowSelection = "MyEventRowSelection"

selectionMode = "LINEEDIT"

keyColumn = "matnr"

table = "<%= t_mat2 %>" >





<htmlb:tableViewColumn columnName = "smeng"

wrapping = "false"

horizontalAlignment = "right"

type = "user"

title = "quantity" >

<htmlb:inputField id = "smeng"

width = "100%"

cellValue = "true"

type = "string" />




request = request

name = 'tableView'

id = 'tvX' ).


tv_data = tv->data.

IF tv_data->SelectedRowIndex IS NOT INITIAL.

DATA value1 TYPE string.

DATA name1 type string.

name1 = tv_data->GET_COLUMN_NAME(

column_index = '3' ).

value1 = tv_data->GET_CELL_ID(

row_index = tv_data->SelectedRowIndex

column_index = '3' ).


request = request

name = 'inputField'

id = value1 ).

data valuex type string.

if inputfield->value is not initial.

valuex = inputfield->value.


==> inputfield->value is ALWAYS empty.

Thanks for help!!

Beat Kohler

Add a comment
10|10000 characters needed characters exceeded

Related questions

1 Answer

  • Posted on Jul 07, 2004 at 11:28 AM

    Hallo Beat,

    Just a small remark, I am not sure if only your example is just a cut&paste mistake, but you are missing <htmlb:content> and <htmlb:page> tags.

    The problem is unfortunately slightly more complex. What you write is:

    <htmlb:tableViewColumn columnName = "smeng" ...> 
      <htmlb:inputField  id   = "smeng"
                         type = "string" />

    What happens here is that when the tags are processed, first the tvColumn tag is started. It is then pushed onto the stack, and then the inputField is completely processed. This tag just have static parameters and writes out its complete output. This is a <b>static string</b> that is now given as input into each cell in this column. So effectively you have N of these inputfields, all with the same name and id of "smeng". Which not the name for which you are trying to retrieve the data again.

    The way that we handled this in design2002 is using a concept called $$ replacement. You can look in SBSPEXT_HTMLB\tableView.bsp for a commented out example of this. Unfortunately, it is <b>NOT</b> possible for us to support this in design2003. Also this $$ concept has caused many problems (special handling all over). It was an idea which we should not have shipped :(.

    Our current recommendation is to write an iterator, and feed the tableView in this way. The same example page has an example of this. Also read the following two articles for some background.

    <b>BSP Programming: BSP Element Expressions (BEEs)</b>


    <b>BSP Programming: HTMLB TableView Iterator</b>



    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.