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

Delete all entities of a collection in one statement

$
0
0

Hi All,

 

I have created a web service to create/Update product.

 

Product - Root entity

Features - Child entity ( 0..n)

 

In this I have  to delete all child entities of relation Features and create new entities.

 

lv_feat =  lv_product->get_related_entities ( relation_name = Features ).

               while lv_feat is bound.

                         lv_feat->delete( ).

                         lv_feat = lv_features->get_next( ).

               endwhile.

               lv_bol_core->modify( ).

 

 

loop it_feat into wa_feat.

    lv_product->create_related_entity( relation_name = Features ).

endloop.

 

 

There are more than 200 entities for deletion. And more than 300 entries for creation. This is taking lot of time( more than 10 sec ). How can I improve its performance?

Is there a way to delete all entities in one method call? I am aware of method CLEAR. I think I can't use this in web service. When I used CLEAR method, after executing the LOOP statement I could see both previous and newly created entries in the relation.

 

 

Please provide some suggestions.

 

 

Thanks,

Pallavi


Viewing all articles
Browse latest Browse all 8372

Trending Articles