Skip to Content

Tableview hide checkbox

I have a BSP-Site with a TableView. But I want to hide some chechboxes. But how can I make it? I use Iterator but I didn't find any solutions.

thx for help

Add a comment
10|10000 characters needed characters exceeded

Related questions

2 Answers

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

    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?

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member Marcel Gäbe

      Hi Marcel

      Usinmg iterator you have an attribute P_ROW_INDEX for the method IF_HTMLB_TABLEVIEW_ITERATOR~RENDER_CELL_START.

      so depending on your condition you can select a particular row and don't show checkbox for that.



  • Posted on Jan 19, 2005 at 02:12 PM

    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



    ':' 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



    ':' m_rowref->isbn INTO str_temp.

    objprevchk->id = str_temp.

    objprevchk->visible = ' '.

    objprevchk->value = '0'.

    CALL METHOD bee_span->add


    element = objchk

    level = 1.

    CALL METHOD bee_span->add


    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'.



    • Creating the Span

    CLEAR html.

    CONCATENATE '<span id=' '"' str_temp '"'


































    INTO html.

    CALL METHOD bee_span->add_html


    html = html.

    p_replacement_bee = bee_span.


    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.


    Add a comment
    10|10000 characters needed characters exceeded

    • Hallo Umashankar,

      No doubt, rule 1 is always "get the job done, whatever it takes". But then comes rule 2: "industrial strength" programming. Heavens forbid, I should not harp on rule 2, as we have had our share problems, many times. But we do try to learn from past experience.

      Things where I would be careful, is when using things such as: '-chk', '-prevchk', 'sapE*' and 'htmlbClientMultiSelect'. There are things so deep in our rendering, they are bound to change with time.

      Specifically in the handling of formfields we have from time to time changed things. With style sheet classes it is not so critical, unless you just between designs. You example will only work for design2002.

      So, mine is a warning voice. If I had to do it, then using an iterator. Like described before, just render yourself a first column of check boxes (using the cl_htmlb_checkbox class). And then handle this part of the logic for you specific type of table. By building your rendering on our building blocks, you also benefit as we change the rendering.


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.