cancel
Showing results for 
Search instead for 
Did you mean: 

Filter planned activites by process type

Former Member
0 Kudos

Hello,

i want to remove all activities of process type 9309 in my BP_BPBT->AccountActivitesOV.

Additional i want to add activites of process type 9312 and 9313 in the list.

How could i implement it?

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi,

Redefine method ON_NEW_FOCUS of BUILACTIVITY context node class . Copy the same code and before setting the collection  me->collection_wrapper->set_collection( lv_collection ) , filter the collection using collection iterator using process type value and  using that iterator add the iterator entries to the new collection and set that collection  to the collection wrapper.

Regards,

Nithish

Former Member
0 Kudos

Do you have an example for filtering the collection with the collection iterator?

Former Member
0 Kudos

Hi ,

Use the below code as an example.

data :  lr_col                 TYPE REF TO if_bol_entity_col,

  lr_iterator            TYPE REF TO if_bol_entity_col_iterator,

  lr_entity             TYPE REF TO if_bol_bo_property_access.

lr_col = iv_collection.
clear iv_collection.

   IF lr_col IS BOUND.
          lr_iterator = lr_col->get_iterator( ).

 

   lr_iterator->filter_by_property( iv_attr_name = 'PROCESS_TYPE'  iv_value = '9309').

  

  lr_entity ?=  lr_iterator->get_first( ).

   WHILE  lr_entity   IS BOUND.

 

iv_collection->if_bol_bo_col~add( iv_entity = lr_entity ).

  lr_entity ?=  lr_iterator->get_next().

endwhile

  endif.

me->collection_wrapper->set_collection( lv_collection ) ,

Regards,

Nithish

Answers (0)