Filter a tableview based on a column value which is not zero.
I need to filter the sales order tableview by Ordered Items.That is my requirement is in ICWC application I want to give a button in the Sales Order view ,on click of which only those items should get displayed which have quantity not equals to 0.
You can implement some code in DO_INIT_CONTEXT to filter your Items' BOL collection based on the condition quantity <> 0. I believe the Quantity field is available in the BOL structure.
Here is a code snippet.
DATA: lr_col TYPE REF TO if_bol_bo_col, DATA: lr_node TYPE REF TO if_bol_bo_property_access. lr_node = me->typed_context->CONTEXT NODE->collection_wrapper->get_first( ). WHILE lr_node IS BOUND. CALL METHOD lr_node->get_properties IMPORTING es_attributes = ls_struct. IF ls_struct-quantity = 0 . lr_col->remove( iv_bo = lr_node ). ENDIF. lr_node = lr_col->get_next( ). ENDWHILE.
Masood Imrani S.