Skip to Content

table_invalid_index

Hi all,

I'm from SAP BW.

one of my job failed and getting error:table_invalid_index

Could you please help me.

Add comment
10|10000 characters needed characters exceeded

  • Hi Krishna,

    The ABAP Program which you are used in PC has this unhandled scenario.

    I was referring the code is below from your post.

    To remove the last rec # from file | | 275|*&-------------------------------------------------------------------* |

    | 276| if p_file+0(2) = '10'. |

    | 277| clear v_lines. |

    | 278| describe table it_tabl lines v_lines. |

    | 279| delete it_tabl index v_lines. |

    | 280| elseif p_file+0(2) = '07'. |

    | 281| clear v_lines. |

    | 282| describe table it_tabl lines v_lines. |

    | 283| delete it_tabl index v_lines. |

    | 284| elseif p_file+0(1) = 'b'. |

    | 285| clear v_lines. |

    | 286| describe table it_tabl1 lines v_lines. |

    |>>>>>| delete it_tabl1 index v_lines. |

    | 288| | | 289| endif. | | 290| |

    | 291|ENDFORM.

    " read_data

    Regards,

    Babu

  • Get RSS Feed

3 Answers

  • Best Answer
    5 days ago

    Hi Krishna,

    The line after 286 is causing error as delete statement attempting to delete the line index with Zero or less than.The index can go to zero when there is no data present in your internal table it_tabl1 so this can be an exception.

    To handle this please have a check on your internal table it_tabl1 for not initial(IF it_tabl1 is not initial -- Statement) before 276 line(means before IF statement for deletion process)

    When there is no data in your internal table it_tabl1 the statement describe will result v_lines = Zero that is being used as index number for deletion.

    Hope you understand.

    Regards,

    Babu.

    Add comment
    10|10000 characters needed characters exceeded

  • 6 days ago

    Hi Krishna,

    Please provide more details on the job failure whether its a DTP/TRFN or ABAP Program error.

    check if there is any internal tables used for read or write where indexing policy has issue.

    Regards,

    Babu

    Add comment
    10|10000 characters needed characters exceeded

  • Hi,

    It was failed at program step

    short dump(st22)

    |Short text | | Error in ABAP/4 statement when processing an internal table.

    |What happened? | | Error in the ABAP Application Program | | | | The current ABAP program "ZBOOKSCAN_CONTROLFILE" had to be terminated because | | it has | | come across a statement that unfortunately cannot be executed.

    |What can you do? | | Note down which actions and inputs caused the error. | | | | | | To process the problem further, contact you SAP system | | administrator. | | | | Using Transaction ST22 for ABAP Dump Analysis, you can look | | at and manage termination messages, and you can also | | keep them for a long time.

    |Error analysis | | When changing or deleting one or more lines of the internal table | | "\PROGRAM=ZBOOKSCAN_CONTROLFILE\DATA=IT_FILES[]" or when inserting in the table | | "\PROGRAM=ZBOOKSCAN_CONTROLFILE\DATA=IT_FILES[]", 0 was used as | | the line index. An index less than or equal to zero is not | | allowed. | | | | The error can occur when using the following options: | | 1. "INDEX idx" for specifying the line number in the table | | "\PROGRAM=ZBOOKSCAN_CONTROLFILE\DATA=IT_FILES[]" | | where you want to change, insert or delete. | | 2. "FROM idx" for specifying the start index when deleting a line | | area from or inserting a line area into the table | | "\PROGRAM=ZBOOKSCAN_CONTROLFILE\DATA=IT_FILES[]". | | 3. "TO idx" for specifying the end index when deleting a line | | area from or inserting a line area into the table | | "\PROGRAM=ZBOOKSCAN_CONTROLFILE\DATA=IT_FILES[]". | | | | At the time of the termination, the table contained 0 lines.

    |How to correct the error | | If the error occurred in your own ABAP program or in an SAP | | program you modified, try to remove the error. | | | | | | If the error occures in a non-modified SAP program, you may be able to | | find an interim solution in an SAP Note. | | If you have access to SAP Notes, carry out a search with the following | | keywords: | | | | "TABLE_INVALID_INDEX" " " | | "ZBOOKSCAN_CONTROLFILE" or "ZBOOKSCAN_CONTROLFILE" | | "READ_DATA" | | | | If you cannot solve the problem yourself and want to send an error | | notification to SAP, include the following information: | | | | 1. The description of the current problem (short dump) | | | | To save the description, choose "System->List->Save->Local File | | (Unconverted)". | | | | 2. Corresponding system log | | | | Display the system log by calling transaction SM21. | | Restrict the time interval to 10 minutes before and five minutes | | after the short dump. Then choose "System->List->Save->Local File | | (Unconverted)". | | | | 3. If the problem occurs in a problem of your own or a modified SAP | | program: The source code of the program | | In the editor, choose "Utilities->More | | Utilities->Upload/Download->Download". | | | | 4. Details about the conditions under which the error occurred or which | | actions and input led to the error.

    To remove the last rec # from file | | 275|*&-------------------------------------------------------------------* |

    | 276| if p_file+0(2) = '10'. |

    | 277| clear v_lines. |

    | 278| describe table it_tabl lines v_lines. |

    | 279| delete it_tabl index v_lines. |

    | 280| elseif p_file+0(2) = '07'. |

    | 281| clear v_lines. |

    | 282| describe table it_tabl lines v_lines. |

    | 283| delete it_tabl index v_lines. |

    | 284| elseif p_file+0(1) = 'b'. |

    | 285| clear v_lines. |

    | 286| describe table it_tabl1 lines v_lines. |

    |>>>>>| delete it_tabl1 index v_lines. |

    | 288| | | 289| endif. | | 290| |

    | 291|ENDFORM.

    " read_data

    Add comment
    10|10000 characters needed characters exceeded