Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

Filter a tableview based on a column value which is not zero.

Hi Guys,

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.

Thanks,

Ashish.

Tags:
Former Member
Former Member replied

Hi Ashish,

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.

Regards,

Masood Imrani S.

0 View this answer in context

Helpful Answer

by
Not what you were looking for? View more on this topic or Ask a question