Skip to Content

DTP Routine problem 0CALDAY

Hi

Hi Could you please let me know where the problem in this code .This one is actually in routine used in DTP in 0CALDAY field and I used the values related with the TVARV table.

This is the code:


DATA: w_datei TYPE d.

tables: tvarvc.

data: l_low(45).

BREAK-POINT.

read table l_t_range with key

fieldname = '0CALDAY' .

select SINGLE low

into l_low

from tvarvc

where name = 'ZIFRSCF_PRIORITARIOS_DEL_RESP'.

l_t_range-low = l_low.

w_datei = SY-DATUM - l_t_range-low.

l_t_range-low = w_datei.

modify l_t_range index l_idx.

However, when I execute the DTP I get an ABAP dump TABLE_INVALID_INDEX. Do you see anything wrong with the code?

dump.PNG (44.4 kB)
Add a comment
10|10000 characters needed characters exceeded

Related questions

1 Answer

  • Posted on Sep 06, 2016 at 11:25 PM

    Hi Pablo,

    Correct as like below.

    Read table l_t_range with key fieldname = 'CALDAY'.

    l_t_range-sign = 'I'.

    l_t_range-option = 'EQ' " BT-Between as per logic

    l_t_range-fieldname = 'CALDAY'.

    l_t_range-low = I_low

    l_t_range-high = "fill to date.

    modify l_t_range index l_idx.

    Regards

    Nanda

    Add a comment
    10|10000 characters needed characters exceeded

    • Hi Pablo,

      Try below code, it works me.

      DATA : L_IDX LIKE SY-TABIX.

      DATA: L_LOW(45.

      READ TABLE L_T_RANGE WITH KEY FIELDNAME = 'CALDAY'.

      IF SY-SUBRC EQ 0.

      L_IDX = SY-TABIX.

      ENDIF.

      SELECT SINGLE LOW INTO L_LOW FROM TVARVC WHERE NAME = 'ZIFRSCF_PRIORITARIOS_DEL_RESP'."Check variable name

      IF SY-SUBRC EQ 0.

      L_T_RANGE-SIGN = 'I'.

      L_T_RANGE-OPTION = 'EQ'.

      L_T_RANGE-FIELDNAME = 'CALDAY'.

      L_T_RANGE-LOW = L_LOW.

      L_T_RANGE-HIGH = L-LOW

      IF L_IDX <> 0.

      MODIFY L_T_RANGE INDEX L_IDX.

      ELSE.

      APPEND L_T_RANGE.

      ENDIF.

      ENDIF.

      P_SUBRC = 0.

      Regards

      Nanda

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.