on 02-10-2015 1:28 PM
Hi All,
I had issue with Mixed Node iteration.
while doing mixed node iteration am getting an null reference in GET_NEXT( ) entity. so could you guys please help onthis issue.
Regards,
Vishwanath.
Hi Vishwanth,
Are you separating both value and model entities before using the entity.
You can check the below code to separate model and value nodes.
Get your collection into a normal entity then assign the entity to mixed node
DATA: lr_mixed TYPE REF TO cl_bsp_wd_mixed_node ,
current TYPE REF TO if_bol_bo_property_access,
lr_current TYPE REF TO cl_crm_bol_entity.
current ?= me->typed_context->entity name->collection_wrapper->get_current( ).
lr_mixed ?= current..
lr_current ?= lr_mixed->if_bsp_wd_ext_property_access~get_model_node( ).
Best Regards
Dharmakasi,
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Dharmakasi,
Its resolved myself.
DATA: lr_col TYPE REF TO if_bol_bo_col.
DATA lr_iterator TYPE REF TO if_bol_bo_col_iterator.
DATA :
lr_mixed TYPE REF TO cl_bsp_wd_mixed_node,
lr_current TYPE REF TO cl_crm_bol_entity,
current TYPE REF TO if_bol_bo_property_access.
* DATA: lr_col TYPE REF TO CL_CRM_BOL_ENTITY_COL.
DATA: lv_erms_text TYPE string.
*
** **** Internal Table to remove entities
DATA: lt_remove TYPE TABLE OF REF TO cl_bsp_wd_mixed_node .
lr_iterator ?= typed_context->wfilistnode->collection_wrapper->get_iterator( ).
CHECK lr_iterator IS BOUND.
current = lr_iterator->get_first( ).
WHILE current IS BOUND.
lr_mixed ?= current.
lr_current ?= lr_mixed->if_bsp_wd_ext_property_access~get_model_node( ).
IF lr_current IS BOUND.
CALL METHOD lr_current->get_property_as_value
EXPORTING
iv_attr_name = 'WI_RHTEXT' "#EC NOTEXT
IMPORTING
ev_result = lv_erms_text.
IF lv_erms_text = 'ERMS decision'.
APPEND lr_mixed TO lt_remove.
* lr_current->Delete( ).
ENDIF.
ENDIF.
current = lr_iterator->get_next( ).
ENDWHILE.
********* remove the entity from internal table lt_remove
****** some few cases entities were missing in loop to remove so used this way to remove
* CLEAR : lr_mixed.
LOOP AT lt_remove INTO lr_mixed.
lr_col ?= typed_context->wfilistnode->collection_wrapper.
TRY .
lr_col->remove( lr_mixed ).
CATCH cx_root.
ENDTRY.
ENDLOOP.
Regards,
Vishwanatha.
Hi Vishwanatha,
When you delete an entity from collection, in WHILE loop, you have to remove that entity from collection and then use get_current( ) method.
lr_enitity = lr_col->get_first( ).
while lr_entity is bound.
if some condition satisfies.
CALL METHOD LR_COL->REMOVE
EXPORTING
IV_ENTITY = LR_ENTITY.
LR_ENTITY->DELETE( ).
lr_entity = LR_COL->get_current( ).
else.
lr_entity = lr_col->get_next( ).
endif.
endwhile.
Regards,
Pallavi
User | Count |
---|---|
5 | |
1 | |
1 | |
1 | |
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.