cancel
Showing results for 
Search instead for 
Did you mean: 

Decision Tree training runtime error. Perform Pruning.

claudio_ciardelli2
Participant
0 Kudos
185

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

Accepted Solutions (0)

Answers (1)

Answers (1)

claudio_ciardelli2
Participant
0 Kudos

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

Former Member
0 Kudos

Hi Claudio,

interesting problem! Could you check the extended pruning without perform pruning?

Klaus

Former Member
0 Kudos

otherwise I would contact SAP because you can't update the temp internal table (See ABAP Coding),

best regards,

Klaus

claudio_ciardelli2
Participant
0 Kudos

No, the "Extended pruning" option can only be chacked when "Perform pruning" has been selected.