Skip to Content
author's profile photo Former Member
Former Member

Decision Tree training runtime error. Perform Pruning.

Hello I get the error below when trying to train a decisio n tree model in RSANWB. The same model trained correctly before I selected Perform Pruning + Extended Pruning in the Parameters tab.

Note 738285 seems to address a similar problem, but is not applicable (or already corrected) in the system I am running (SAPKW35012, SAPKIBIFP5).

Can anyone help me on that?

Claudio Ciardelli

Here is the error log.

Runtime Errors         TABLE_FREE_IN_LOOP
Date and Time          28.07.2005 15:40:59
----------------------------------------------------------------------------------------------------

----------------------------------------------------------------------------------------------------
|ShrtText                                                                                |
|    When you LOOP through an internal table, you must not change it.                              |
----------------------------------------------------------------------------------------------------

----------------------------------------------------------------------------------------------------
|What happened?                                                                                |
|    Error in ABAP application program.                                                            |
|                                                                                |
|    The current ABAP program "SAPLRS_DME_DECISION_TREE_PRUNE" had to be terminated                |
|     because one of the                                                                           |
|    statements could not be executed.                                                             |
|                                                                                |
|    This is probably due to an error in the ABAP program.                                         |
----------------------------------------------------------------------------------------------------

----------------------------------------------------------------------------------------------------
|Error analysis                                                                                |
|    When you LOOP through an internal table, the table as a whole may                             |
|    not be changed,                                                                               |
|    SORT, MOVE, REFRESH, and CLEAR are, for example, not allowed.                                 |
----------------------------------------------------------------------------------------------------

----------------------------------------------------------------------------------------------------
|Trigger Location of Runtime Error                                                                 |
|    Program                                 SAPLRS_DME_DECISION_TREE_PRUNE                        |
|    Include                                 LRS_DME_DECISION_TREE_PRUNEF01                        |
|    Row                                     163                                                   |
|    Module type                             (FORM)                                                |
|    Module Name                             UPDATE_BRANCH_NEW                                     |
----------------------------------------------------------------------------------------------------

----------------------------------------------------------------------------------------------------
|Source Code Extract                                                                               |
----------------------------------------------------------------------------------------------------
|Line |SourceCde                                                                                |
----------------------------------------------------------------------------------------------------
|  133|  IF sy-subrc EQ space.                                                                     |
|  134|    l_parent_index = sy-tabix.                                                              |
|  135|    LOOP AT gt_tree_sorted                                                                  |
|  136|       ASSIGNING <fs_tree>                                                                  |
|  137|       FROM l_parent_index.                                                                 |
|  138|      IF <fs_tree>-parent NE p_node.                                                        |
|  139|        EXIT.                                                                               |
|  140|      ENDIF.                                                                                |
|  141|      CHECK <fs_tree>-node NE p_branch.                                                     |
|  142|      l_node_index = sy-tabix.                                                              |
|  143|      PERFORM delete_children_new USING <fs_tree>-node.                                     |
|  144|      DELETE gt_tree_sorted INDEX l_node_index.                                             |
|  145|    ENDLOOP.                                                                                |
|  146|  ENDIF.                                                                                |
|  147|* Update Parent = P_NODE for all Childnodes of P_BRANCH                                     |
|  148|  READ TABLE gt_tree_sorted TRANSPORTING NO FIELDS                                          |
|  149|    WITH KEY parent = p_branch BINARY SEARCH.                                               |
|  150|  IF sy-subrc EQ space.                                                                     |
|  151|    l_parent_index = sy-tabix.                                                              |
|  152|    LOOP AT gt_tree_sorted                                                                  |
|  153|       ASSIGNING <fs_tree>                                                                  |
|  154|       FROM l_parent_index.                                                                 |
|  155|      IF <fs_tree>-parent NE p_branch.                                                      |
|  156|        EXIT.                                                                               |
|  157|      ENDIF.                                                                                |
|  158|      l_node_index = sy-tabix.                                                              |
|  159|      <fs_tree>-parent = p_node.                                                            |
|  160|    ENDLOOP.                                                                                |
|  161|  ENDIF.                                                                                |
|  162|* Sort again..since parent info is changed..                                                |
|>>>>>|  SORT gt_tree_sorted BY parent node.                                                       |
|  164|* Update Parent = P_NODE for all Childnodes of P_BRANCH                                     |
|  165|  READ TABLE gt_tree_sorted TRANSPORTING NO FIELDS                                          |
|  166|    WITH KEY parent = p_branch_parent                                                       |
|  167|             node = p_branch BINARY SEARCH.                                                 |
|  168|  IF sy-subrc EQ space.                                                                     |
|  169|    DELETE gt_tree_sorted INDEX sy-tabix.                                                   |
|  170|  ENDIF.                                                                                |
|  171|                                                                                |
|  172|                                                                                |
|  173|ENDFORM.                    "update_branch_new                                              |
|  174|                                                                                |
|  175|*&---------------------------------------------------------------------*                    |
|  176|*&      Form  update_tree                                                                   |
|  177|*&---------------------------------------------------------------------*                    |
|  178|*       text                                                                                |
|  179|*----------------------------------------------------------------------*                    |
|  180|*      -->P_I_T_CLASSDIST  text                                                             |
|  181|*      -->P_I_NODE  text                                                                    |
|  182|*----------------------------------------------------------------------*                    |
----------------------------------------------------------------------------------------------------

Message was edited by: Claudio Ciardelli

Add a comment
10|10000 characters needed characters exceeded

Related questions

1 Answer

  • author's profile photo Former Member
    Former Member
    Posted on Jul 28, 2005 at 01:54 PM

    The error seems to occur only when I check the Extended Prining option.

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.