Skip to Content
1
Apr 27, 2011 at 09:04 AM

lr_entity ?= lr_coll->get_next( ) is not working

570 Views

Hi,

for me lr_entity ?= lr_coll->get_next( ). is not working. When the code reaches to lr_entity ?= lr_coll->get_next( )., the lr_entity becomes initial and comes out of the while loop. Please have a look into the following piece of code. I am extracting and manupulating opportunity serach result data.

DATA: lv_page_id TYPE string,

lr_view_controller TYPE REF TO cl_bsp_wd_view_controller,

lr_cuco TYPE REF TO cl_bt111s_o_cucosearch_impl,

lr_entity TYPE REF TO cl_crm_bol_entity,

lr_coll TYPE REF TO if_bol_bo_col,

lr_collection TYPE REF TO cl_bsp_wd_collection_wrapper.

CALL METHOD server->request->get_form_data

EXPORTING

name = 'page_id'

CHANGING

data = lv_page_id.

lr_view_controller ?= cl_chtmlb_config_tab_excel_exp=>controller_get( iv_id = lv_page_id ).

lr_cuco ?= lr_view_controller->get_custom_controller( 'BT111S_OPPT/CucoSearch' ).

lr_collection ?= lr_cuco->typed_context->result->get_collection_wrapper( ).

lr_coll ?= lr_collection.

lr_entity ?= lr_coll->get_first( ).

WHILE lr_entity IS NOT INITIAL.

lr_entity->get_properties( IMPORTING es_attributes = ls_opp_btil ).

-

-

-

-

-

-

-

lr_entity ?= lr_coll->get_next( ).

ENDWHILE.

But at lr_entity ?= lr_coll->get_next( ), it is not picking the 2nd record whereas the data is available in lr_coll. Please help me!