cancel
Showing results for 
Search instead for 
Did you mean: 

Using tableview to accept Input

Former Member
0 Kudos

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

Accepted Solutions (0)

Answers (6)

Answers (6)

former_member181879
Active Contributor
0 Kudos

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.

Former Member
0 Kudos

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

Former Member
0 Kudos

hi,

Can you debug the class implementation ??

Actually, in my case I am getting the edited values as per my requirements, but at certain points I want to debug the class implementation.. and specially render-cell-start method of the interface implementation..

Could you help?

athavanraja
Active Contributor
0 Kudos

yes you can. place a HTTP break point.

Regards

Raja

Former Member
0 Kudos

hi,

Tableview iterator is specified in the layout in the tableview tag.

Now for this iterator, i have class implemented.

I want to debug the interface methods - render_col_start and render_row_start for this iterator.

I set the HTTPbreakpoint, but it doesnt take me to these implementations.

How can I reach to that point?

Regards,

Krupa

Former Member
0 Kudos

In WAS 6.20, you can set breakpoints based on username. So incase you are running as a different user, and have set breakpoint for your username in the code, breakpoints will not get activated.

Regards,

Subramanian V.

Former Member
0 Kudos

Nice idea to post about jobs but perhaps not the best place to do so.

If you need help just post a message and we'll all give a helping hand.

Former Member
0 Kudos

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

Former Member
0 Kudos

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

Former Member
0 Kudos

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

Former Member
0 Kudos

Hi

are you modifing your internal table in the onInputprocessing event with tableview values?

Can u paste your code for onInputproceessing here.

Regards

Naresh

Former Member
0 Kudos

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

Former Member
0 Kudos

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

Former Member
0 Kudos

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