on 04-10-2009 8:50 AM
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.
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Yes Indeed, it takes a considerable time.
There are methods like lr_bp_col_iterator->filter_by_property, but they can be achieved when the attribute quantity exists in the BOL.
But, since you want this thing to happen at UI level based on a button click, I was not able find any way other than accessing the relations.
You can evaluate all the options like
1. accessing the relation of quantity and MARK all the entities to be filtered.
then removing the marked entities
2. using REMOVE methods directly.
3. enhancing the table structure to include the quantity field and use
lr_bp_col_iterator->filter_by_property
( I thought, this is also one of the methods)
meanwhile I'll look for anything new...!
I am wondering if a simple order read with all the order IDs would do.
Maybe you can call CRM_ORDER_READ in the on_new_focus method of the tableview node. There is an exporting paramter containing the quantity, I do not remember which one it is right now. Try the test report in SE38 if you need to have a look.
cheers Carsten
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
6 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.