Marcel, do us all a favor and describe your tableView problem in a little more detail. Are you using MULTI-/SINGLESELECT, the pertaining 'checkboxes' or a column with checkbox elements? What do you mean by <i>hide some checkboxes</i>? What did you do with your iterator that didn't work?
Hi Marcel,
I too faced same problem. When i cross checked with forum, there are lot of questions on this requirement so i did some R&D on this i came up with indirect solution.
Table view Checkbox is SAP standard Checkboxes so we don't have any control on that.
Instead of that we can create our own column, which looks similar to the table view check box.
This code will work only for Multi Select
For this we need to give table view properties as
<htmlb:tableView id = "t_search"
width = "100%"
headerVisible = "false"
footerVisible = "true"
design = "alternating"
fillUpEmptyRows = "TRUE"
tabIndexCell = "false"
filter = "SERVER"
sort = "SERVER"
selectionMode = "NONE"
visibleRowCount = "<%= v_line_count %>"
selectedRowIndexTable = "<%= o_model->it_sel_books %>"
visibleFirstRow = "1"
iterator = "<%= TV_ITERATOR %>"
table = "<%= o_model->IT_BOOKS %>"
keyColumn = "ISBN"/>
In table iterator we need to add one dummy column for which we can provide this functionality for this I taken dummy column
IF m_rowref->flag IS INITIAL.
CREATE OBJECT objchk.
CREATE OBJECT objprevchk.
CREATE OBJECT bee_span.
moving the cell id and row id into string variables
row_index1 = p_row_index.
CONDENSE row_index1 NO-GAPS.
need to be changed
row_index = row_index1.
CONCATENATE component_id if_bsp_controller~co_sep 't_search'
INTO cell_index.
Creating the 1st Hidden inputfiled
CLEAR str_temp.
CONCATENATE cell_index
'-chk'
row_index
':' m_rowref->isbn INTO str_temp.
objchk->id = str_temp.
objchk->visible = ' '.
objchk->value = ''.
Creating the 2nd Hidden inputfiled
CLEAR str_temp.
CONCATENATE cell_index
'-prevchk'
row_index
':' m_rowref->isbn INTO str_temp.
objprevchk->id = str_temp.
objprevchk->visible = ' '.
objprevchk->value = '0'.
CALL METHOD bee_span->add
EXPORTING
element = objchk
level = 1.
CALL METHOD bee_span->add
EXPORTING
element = objprevchk
level = 2.
CLEAR str_temp.
CONCATENATE cell_index '_selrow_' row_index
':' m_rowref->isbn INTO str_temp.
CLEAR : arg1,arg2,arg3,arg4.
creating javascript function arguments
CONCATENATE cell_index '-chk' INTO arg1.
CONCATENATE cell_index '-prevchk' INTO arg2.
CONCATENATE row_index ':' m_rowref->isbn INTO arg3.
arg4 = str_temp.
s_class = 'sapETbvSelIndicatorFalse'.
IF m_model->it_select[] IS NOT INITIAL.
wa_int4_in = p_row_index.
READ TABLE m_model->it_select INTO wa_int4_out
FROM wa_int4_in.
IF sy-subrc = 0.
s_class = 'sapETbvSelIndicatorTrue'.
ENDIF.
ENDIF.
Creating the Span
CLEAR html.
CONCATENATE '<span id=' '"' str_temp '"'
cl_abap_char_utilities=>horizontal_tab
'class='
'"'
s_class
'"'
cl_abap_char_utilities=>horizontal_tab
'onkeypress='
'"'
'htmlbIC()'
'"'
cl_abap_char_utilities=>horizontal_tab
'onClick='
'"'
'htmlbClientMultiSelect('
''''
arg1
''''
','
''''
arg2
''''
','
''''
arg3
''''
','
''''
arg4
''''
')'
'">'
' '
'</span>'
INTO html.
CALL METHOD bee_span->add_html
EXPORTING
html = html.
p_replacement_bee = bee_span.
ELSE.
create object obj_image.
obj_image->SRC = '/sap/public/bsp/sap/public/bc/bsp/icons/s_n_crit.gif'.
obj_image->width = '12'.
obj_image->height = '12'.
obj_image->TOOLTIP ='This Disabled'.
p_replacement_bee = obj_image.
ENDIF.
Add a comment