I wish someone has come across this before and had cracked it.
This error is triggered by multiple applications, however at one stage below active calls for all errors has these:
82 METHOD CL_TRIGGER_COLL_PPF===========CP CL_TRIGGER_COLL_PPF===========CM005 6
81 METHOD CL_TTYPE_PPF==================CP CL_TTYPE_PPF==================CM005 463
80 METHOD CL_CONTEXT_MANAGER_PPF========CP CL_CONTEXT_MANAGER_PPF========CM003 59
79 METHOD CL_MANAGER_PPF================CP CL_MANAGER_PPF================CM002 93
78 FUNCTION SAPLCRM_ACTION LCRM_ACTIONU03 127
Below source code where error occurred behaves strangely and leaves no clue on what happened:
1 method GET_NEXT_ELEMENT .
3 * if get_number_of_elements( ) <> 0.
4 read table ref_table index iterator into ro_element.
5 if sy-subrc <> 0.
>>>>> raise element_not_found.
8 iterator = iterator + 1.
9 * else.
10 * raise no_elements.
11 * endif.
This method is called in loop as below:
*---------------------process triggers at once-----------------
counter = current_trigger_list->get_number_of_elements( ).
DO counter TIMES.
lo_trigger = current_trigger_list->get_next_element( ).
* reset the relevant date (l_relevant is initial)
lo_trigger->set_relevant( l_relevant ).
* set the trigger at the medium to make sure both instances are
* registered for saving "note 1474344
lo_medium = lo_trigger->get_medium( ).
lo_medium->set_trigger( lo_trigger ).
* if an optimization rule is used, (re)calculate relevant date;
* date might have been changed; will be set within the evaluation;
* we do not care about the return value here "note 1288535 >>
if lo_trigger->get_optrule( ) is not initial.
lo_trigger->evaluate_startcond( ip_check_opt_rule = sppf_true ).
endif. "note 1288535 <<
* process triggers that are unprocessed and have the correct
* processing time (3)
IF lo_trigger->get_status( ) EQ sppf_status_unprocessed AND
lo_trigger->get_dispatch( ) EQ sppf_process_at_once.
* EXECUTE method checks for locked an inactive triggers,
* no need to check outside of object
CALL METHOD lo_trigger->if_action_ppf~execute
OTHERS = 1.
IF sy-subrc NE 0.
* Ignore all errors
On every error, the iterator in "read table ref_table index iterator into ro_element" is always one greater than counter, implying that do loop has looped one extra time. The code above should not call get_next_element third time if counter is 2.
When looped for third time and read on REF_TABLE fails raising exception. The only way this can happen is if the counter value is subtracted / reset inside the loop which can not happen. This can not be reset by other called methods inside the loop as counter is local variable declared in method.
Did someone come across such issue before? any information regarding this / suggestions on where possible would really help the analysis.
Thanks and regards,