cancel
Showing results for 
Search instead for 
Did you mean: 

BSP Table View - Input Filed with value help in Filter cell

Former Member
0 Kudos

Hi all,

I'm trying to add an input field with an value help inside the table filter cell of table view.

Have any one tried this before or any suggestions how to proceed on this.

Thanks,

Trikanth

Accepted Solutions (1)

Accepted Solutions (1)

thomas_jung
Developer Advocate
Developer Advocate
0 Kudos

I haven't done it, but the SAP example application SBSPEXT_TABLE does have an example of this. Is there some particular aspect that you were wondering about?

Former Member
0 Kudos

Hi Thomas,

Thanks for the response.

Actually i have already looked in to <b>SBSPEXT_TABLE</b> and i am also able to place a dropdown in the table filter cell, but now i came across a situation where i need to place a input filed with a custom value help only inside the filter cell and i didn't find any example for this.

Any ideas / suggestions on this ?

Thanks & Regards,

Trikanth

thomas_jung
Developer Advocate
Developer Advocate
0 Kudos

Actually SBSPEXT_TABLE does have somethign close to an example of this in CL_TREE_ITERATOR (at least on 640 SP12).

You will just need to create your inputfield in your iterator and attach your ONVALUEHELP event in the code.


if p_column_index eq 6.
    p_isreadonly = abap_false.
    data inputfield type ref to cl_htmlb_inputfield.
    create object inputfield.
    inputfield->id = p_cell_id.
    inputfield->type = 'date'.
    inputfield->showhelp = abap_true.
    data: help_javascript type string.
    concatenate `ShowHelp('`
                 p_cell_id
                `');` into help_javascript.
    inputfield->onvaluehelp = help_javascript.
    inputfield->value = get_column_value( column_name = p_column_key ).
    p_replacement_bee = inputfield.
    return.
  elseif p_column_index ne 1.
    return.
  endif.

Is this what you were looking for? - the rendering? Or were you more concerned with the processing of the value help request.

Former Member
0 Kudos

HI Thomas,

Thanks again.

Actually the code renders input field with value help in the table cells, but i need to place the input field with value help only in the table filter cell and the column filter cell is not having any index assigned to it, the how can we capture the filter cell id ?

Thanks & Regarding,

Trikanth

thomas_jung
Developer Advocate
Developer Advocate
0 Kudos

I'm sorry - I must be way out in Left Field. Up till now I completly missed the whole Filter Cell part of your question. I thought you were trying to do this in the body of the table.

So you are using the columnFilters attribute of the <htmlb:tableView> and filling an internal table of type tableviewFilterTab.


            append initial line to filters assigning <filter>.
            <filter>-columnName = 'PLANETYPE'.
            <filter>-isf4help = 'X'.
            <filter>-onvaluehelp = `alert('F4 Help')`.

But your problem is getting the cell id.

Looking at the code that is rendered under that situation you get an input field id like the following:

tsi2$filter_4

tsi2 is the id of my tableView. 4 is the index of the column that the input field is filtering for. I would assume that based upon this naming standard you could predetermine what the id will be as long as you know what column the help will be fired for.

Now like I told someone the other day, JavaScript isn't my strongest point so I usually have to dig on the internet. But I think you could have the JavaScript Function that you call pass in this.id. That should pass in the id of the object firing the event. Since it is actually a button element that is firing the event (ID = tsi2$filter_4-btn), you would have to work back from the naming of the button to the naming of the input field. But that could be less risky.

Try this sample to find out:

<filter>-onvaluehelp = `alert(this.id)`.

Former Member
0 Kudos

Hi Thomas,

Thanks alot.

I am able to place a value help in the table filter cell now.

Thanks & Regards,

Trikanth

Answers (0)