Quantcast
Channel: SCN: Message List
Viewing all articles
Browse latest Browse all 9159

Re: Sorting Partner in Parties involved

$
0
0

Hi Paolo,

 

You have to do that requirement by custom development. One solution could be to use one reference variable of collection to manage the sorting, and when this sorting is finished assign this collection to context.

 

For example:

lr_bol_iterator1 ?= typed_context->btpartner->collection_wrapper->get_iterator( ).

lr_bol_iterator2 = lr_bol_iterator1.

 

******* First of all, we are gonna filter by customers only.******

lr_bol_iterator1->FIND_BY_PROPERTY( IV_ATTR_NAME = 'PARTNER_FCT'

                                    IV_VALUE     = 'ZAAAA' ).

lv_partner ?= lr_bol_iterator->get_first( ).

 

WHILE lv_partner IS BOUND.

 

**** Adding customers to collection.

    lr_new_collection->if_bol_bo_col~add( iv_entity = lv_partner).

 

* Get the BP Number of customer

    lr_dref = lv_partner->get_property( iv_attr_name = 'BP_PARTNER_NO' ).

 

* After that we have to search for contact persons of customer into BUT050

.....

 

Loop at lt_contacts into lv_contact_no.

* With these contact persons we can search into original colection these contacts.

    lr_contact ?= lr_bol_iterator2->find_by_property( IV_ATTR_NAME = 'PARTNER_NO'

                                                          IV_VALUE     = lv_contact_no ).

    If lr_contact is bound.

**************** Adding contacts behind customers.

        lr_new_collection->if_bol_bo_col~add( iv_entity = lr_contact ).

    endif.

Endloop.

 

lv_partner ?= lr_bol_iterator->get_next( ).

 

endwhile.

 

** Finaly we add the new collection to context.

typed_context->btpartner->collection_wrapper->clear( ).

typed_context->btpartner->collection_wrapper->set_collection( lr_new_collection ).

 

 

 

I hope that helps you.

 

Best regards,

Jorge Ocampos.


Viewing all articles
Browse latest Browse all 9159

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>