| Home • Tips • Tutorials • Forums • Certification Q's • Interview Q's • Jobs • Testimonials • Contact Us | ||
Document Categories:
What's New?
Contribute?Sample SpecsWhat's Hot? |
Sorting a table column in a WebDynpro application9. Click the Button Context. It will open a Popup for
Selecting Context Element.
10. Select MARA and Press Enter.
11. It will show all the Context Attributes in that Node.
Then Press Enter.
12. Go to Attributes Tab, Give TABLE_CONTROL in the Attribute
Column , Check the Check Box in the RefTo Column & give
IF_WD_TABLE_METHOD_HNDL in the Associated Type.
13. Then create one Event for onSort Event of the Table by
Clicking the Create Button as shown below. Then Give the Action Name as
ON_TEST_SORT and press Enter.
14. Then go to the Methods Tab.
WDDOINIT: method WDDOINIT . data LO_ND_MARA type ref to IF_WD_CONTEXT_NODE. data LO_EL_MARA type ref to IF_WD_CONTEXT_ELEMENT. data LT_MARA type WD_THIS->ELEMENTS_MARA. data LS_MARA type WD_THIS->ELEMENT_MARA. * navigate from <CONTEXT> to <MARA> via lead selection LO_ND_MARA = WD_CONTEXT->GET_CHILD_NODE( NAME = WD_THIS->WDCTX_MARA ). SELECT MATNR MTART MATKL MEINS FROM MARA INTO CORRESPONDING FIELDS OF
TABLE LT_MARA UP TO 10 ROWS WHERE MATNR LIKE 'A%'.
* Bind Table LO_ND_MARA->BIND_TABLE( LT_MARA ). endmethod. WDDOMODIFYVIEW: method WDDOMODIFYVIEW . data wd_table type ref to cl_wd_table. check first_time = abap_true. * Name of the table UI element to be provided wd_table ?= view->get_element( 'TABLE' ). wd_this->table_control ?= wd_table->_method_handler. *Name of the key attribute of the context node to which the table binding is done to be provided wd_this->table_control->set_key_attribute_name( 'MATNR' ). endmethod. ONACTIONON_TEST_SORT: method ONACTIONON_TEST_SORT . wd_this->table_control->apply_sorting( ). endmethod.
16.
Save and Activate the Application.
17. Create WebDynpro Application,
save it and Test the Application. Output:
|
|
|
Please send us your feedback/suggestions at webmaster@SAPTechnical.COM Home • Contribute • About Us • Privacy • Terms Of Use • Disclaimer • Safe • Companies: Advertise on SAPTechnical.COM | Post Job • Contact Us ©2006-2007 SAPTechnical.COM. All rights reserved. All
product names are trademarks of their respective companies. SAPTechnical.COM
is in no way affiliated with SAP AG. Graphic Design by Round the Bend Wizards |
||