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

Issue in DTP Routine

Hi Experts,

I have written a routine in DTP for filtering the records based on CALDAY, Below is the code which is used for calculating the last years first day and current years latest period last day. Code is working fine to populate the CALDAY with required dates, but it is throwing shortdump.

SELECT * FROM /bic/pzgpcvmper

INTO TABLE it_pcvmper

WHERE objvers = 'A'.

IF sy-subrc = 0.

READ TABLE it_pcvmper INTO wa_pcvmper

WITH KEY /bic/zgpcvmper = 'P1'. "Previous Year

IF sy-subrc = 0.

lv_p_first_day = wa_pcvmper-/bic/zpfirstdy.

lv_p_last_day = wa_pcvmper-/bic/zplastday.

ENDIF.


READ TABLE it_pcvmper INTO wa_pcvmper

WITH KEY /bic/zgpcvmper = 'P2'. "Current Year

IF sy-subrc = 0.

lv_c_first_day = wa_pcvmper-/bic/zpfirstdy.

lv_c_last_day = wa_pcvmper-/bic/zplastday.

ENDIF.

ENDIF.

READ TABLE l_t_range

WITH KEY fieldname = i_fieldnm. "'CALDAY'.

l_idx = sy-tabix.

l_t_range-sign = 'I'.

l_t_range-iobjnm = '0CALDAY'.

l_t_range-fieldname = 'CALDAY'.

l_t_range-option = 'BT'.

l_t_range-low = lv_p_first_day.

l_t_range-high = lv_c_last_day.


IF l_idx <> 0.

MODIFY l_t_range INDEX l_idx.

ELSE.

l_t_range-fieldname = 'CALDAY'.

APPEND l_t_range.

ENDIF.

p_subrc = 0.

When i trigger the DTP in Debug mode i am getting below dump which is related to Table Index Issue. And below is the short dump,

Category ABAP Programming Error

Runtime Errors TABLE_INVALID_INDEX

ABAP Program GP00O2SNJ0T4TH4P5HDP3Z303GL

Application Component Not Assigned

Date and Time 14.10.2014 19:15:45

Error analysis
When changing or deleting one or more lines of the internal table
"\PROGRAM=GP00O2SNJ0T4TH4P5HDP3Z303GL\DATA=G_T_SELFIELDS" or when inserting in
the table "\PROGRAM=GP00O2SNJ0T4TH4P5HDP3Z303GL\DATA=G_T_SELFIELDS", 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=GP00O2SNJ0T4TH4P5HDP3Z303GL\DATA=G_T_SELFIELDS"
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=GP00O2SNJ0T4TH4P5HDP3Z303GL\DATA=G_T_SELFIELDS".
3. "TO idx" for specifying the end index when deleting a line
area from or inserting a line area into the table
"\PROGRAM=GP00O2SNJ0T4TH4P5HDP3Z303GL\DATA=G_T_SELFIELDS".

At the time of the interruption the table contained 75 lines.

Can any one help me in sorting the above mentioned issue,

Thanks,

Ramana Tarapatla

Message was edited by: Ramana Prasad Tarapatla

Add a comment
10|10000 characters needed characters exceeded

Related questions

3 Answers

  • Posted on Oct 14, 2014 at 01:26 PM

    Hi,

    as per shortdump, the below line of code is giving short dump.

    MODIFY l_t_range INDEX l_idx.

    Please check once again, above line of code working correctly or not.

    Regards,
    Nagaraju K

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Oct 14, 2014 at 01:37 PM

    Hi Ramana,

    There is a issue in your code. I have corrected the code. Please let me know if this solves.

    Thanks

    Amit

    l_t_range-sign = 'I'.

    l_t_range-iobjnm = '0CALDAY'.

    l_t_range-fieldname = 'CALDAY'.

    l_t_range-option = 'BT'.

    l_t_range-low = lv_p_first_day.

    l_t_range-high = lv_c_last_day.

    READ TABLE l_t_range

    WITH KEY fieldname = i_fieldnm. "'CALDAY'.

    l_idx = sy-tabix.

    IF sy-subrc EQ 0.

    IF l_idx <> 0.

    MODIFY l_t_range INDEX sy-tabix l_idx.

    ELSE.

    l_t_range-fieldname = 'CALDAY'.

    APPEND l_t_range.

    ENDIF.

    p_subrc = 0.

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member

      Hi Amit,

      Thanks for your response.

      I have tried the options mentioned by you, but still it is not working in debugging mode.

      When i executed the DTP directly without any debug mode it is working fine as expected. But when i tried to debug the DTP Routine or expert routine, it is going to dump.

      Please suggest..

      Thanks,

      Ramana Tarapatla

  • Posted on Jun 28, 2016 at 12:25 PM

    Hi Ramana,

    could you solve the problem?

    What is the cause for the dump?

    Best Regards

    Florian

    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.