cancel
Showing results for 
Search instead for 
Did you mean: 

tableview filter=application

Former Member
0 Kudos

Hi,

I want to use a tableview with filter type "application". How can I access the filter values the user has entered?

thanks, Claudia

View Entire Topic
Former Member
0 Kudos

Have you checked out the examples?

I've not tried it myself.

BSP Application: SBSPEXT_TABLE

Claudia_Dangers
Advisor
Advisor
0 Kudos

Sure I have, but I didn't found any solution. (

Former Member
0 Kudos

If I get a chance I'll plan around as well but maybe someone else will post before then

athavanraja
Active Contributor
0 Kudos

<b>cl_htmlb_event_tableview</b> has got a method called <b>get_row_filter_value</b>

You can use this method to get the filter value.

Regards

Raja

Former Member
0 Kudos

look at that Raja to the rescue!!!

Claudia_Dangers
Advisor
Advisor
0 Kudos

Hi Raja,

thanks for the hint. This will be the first step on my way to hit the goal. Next step will be to change this value (I have to call the conversion exit to add the leading zero's) and to write it back, so that server filtering will use the changed value. Is there also a possibility to set the filter value? Unfortunately cl_htmlb_event_tableview has none.

thanks a lot, Claudia

athavanraja
Active Contributor
0 Kudos

I have given below the code method get_row_filter_value


data: column_index_str type string. 
 column_index_str = column_index.
  data name type string.
  concatenate id
              '-filter_'
              column_index_str
         into name.
  condense name no-gaps.
  value = request->get_form_field( name ).

You can do a reverse of this by building the <b>name</b> and use request->set_form_field.

I haven't tried but it should work.

Regards

Raja

PS: If this has answered your question can mark the thread as answered and also you may want to check out this link as i see you are a new user to SDN

https://www.sdn.sap.com/sdn/index.sdn?page=crp_help.htm#posted

Claudia_Dangers
Advisor
Advisor
0 Kudos

I already tried to use set_form_field, but it does not work to change the actual incoming request.

athavanraja
Active Contributor
0 Kudos

There should be a way out, let me check out and get back to you. Its already late and i have to go home.

Regards

Raja

athavanraja
Active Contributor
0 Kudos

I have found a solution to handle your case with javascripts.

In your onManipulation event.

use the following code to get the response string.

and modify the string to add your javascript.


CALL METHOD runtime->server->response->get_cdata
   RECEIVING
     data = test.
*now the string test will have a line like this for each *of the filter fields.

*<input class="sapEdfFltr" style="height:100%;" *name="<tableviewid>-filter_<column number>" value="" *onkeyDown="htmlbF('sldapt-filterEvt')">
modify this line to add a javascript for onchange event and handle your data manipulation there.
REPLACE ALL OCCURRENCES OF 'xxxxxxx' IN test WITH
 'xxxxx onchange="javascript:alert(this.value)"'. 
if sy-subrc eq 0 .
runtime->server->response->set_cdata( test ).
endif .

hope this is clear.

Regards

Raja

Former Member
0 Kudos

Hi,

i try to initialize the filtervalues which were set by the user. i use in the onInputProcessing:


              CALL METHOD CL_HTMLB_MANAGER=>SET_FILTER_ROW_VALUE
                EXPORTING
                  REQUEST      = request
                  ID           = 'MyTableViewID'
                  COLUMN_INDEX = col_index
                  VALUE        = ' '.

This takes no effect to the filter. In the browser you dont see any changes. I am wondering because here we have to do with the "request" Isnt it that i have to change the "response".

Maybe someone has similar experieneces with initializing the filter.

thorsten

daniel_humberg
Contributor
0 Kudos

Hi Thorsten,

have you tried to use the response object instead of the request object?

(One more thing: I noticed, that the your coding only does not work for value = space, while it will work for any other value....).