Step 1 :
Create a Webdynpro component.
Step 2 :
Create a context node as shown below.
Since we are going to use connid as filter value, we have
added it in the node filter_vale.
Step 3 :
Create a table and create binding for that.
Step 4 :
Now go to the connid column of the table and in the property
filter value , bind the attribute which we have created earlier.
Step 5 :
After binding, Go to attributes Tab and create a attribute
as shown below.
Table_hndl type ref to if_Wd_table_method_hndl.
Step 6 :
Create a action on table on filter as shown below
Paste the code inside the method filter.
wd_this->table_hndl->apply_filter(
).
Step 7 :
Now go to init method and write code to fill data for the
table.
DATA lo_nd_sflight TYPE REF TO if_wd_context_node.
DATA lt_sflight TYPE wd_this->Elements_sflight.
* navigate from <CONTEXT> to <SFLIGHT> via lead selection
lo_nd_sflight = wd_context->get_child_node( name = wd_this->wdctx_sflight ).
Select * from sflight into corresponding fields of table lt_Sflight up to 10 rows.
lo_nd_sflight->bind_table( new_items = lt_sflight set_initial_elements = abap_true ).
Step 8:
Now go to modifyview and write the following code to enable the filter Option for the table.
DATA: l_table TYPE REF TO cl_wd_table.
* Get reference of the table view element
l_table ?= view->get_element( 'TABLE' ). " HERE WE HAVE TO GIVE THE TABLE NAME.
* Get reference to the Filter & Sorting API
wd_this->TABLE_HNDL ?= l_table->_method_handler.
* Set the table’s filter action
l_table->set_on_filter( 'FILTER' ).
Step 9:
Create a Webdynpro application and test the application.
Step 10:
Now put some value in the filter area and click on filter button.
Say for example lets put 0017 to search and the result is
Regards
Aravindan
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
8 | |
5 | |
5 | |
4 | |
4 | |
4 | |
3 | |
3 | |
3 | |
3 |