Hello Naveen,
Thanks for your quick reply. I already tried in DO_INIT_CONTEXT method.
But the problem my sample code doesnt work in the method. The iterator throws error.
How should I change my code for DO_INIT_CONTEXT?
My sample code:
data: lo_iterator type ref to if_bol_bo_col_iterator,
lo_current type ref to if_bol_bo_property_access,
rt_buttons type crmt_thtmlb_button_t,
it_zmodul type table of zmodul,
ls_zmodul like line of it_zmodul,
lv_lines type i,
ls_value TYPE string.
if iv_first_time eq abap_true.
me->mv_min_empty_lines = 2.
call method super->do_prepare_output
exporting
iv_first_time = iv_first_time.
lo_iterator ?= me->typed_context->TABLE_CONTEXT_NODE->collection_wrapper->get_iterator( ).
if lo_iterator is bound.
* Get the first line
lo_current ?= lo_iterator->get_first( ).
while lo_current is bound.
lo_current->set_property_as_string( iv_attr_name = 'ZZABC' iv_value = 'ABC' ).
* Get the next line
lo_current ?= lo_iterator->get_next( ).
endwhile.
endif.
else.
me->mv_min_empty_lines = 0.
call method super->do_prepare_output
exporting
iv_first_time = abap_false.
endif.