on 09-06-2016 11:06 PM
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?
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
User | Count |
---|---|
86 | |
10 | |
10 | |
9 | |
6 | |
6 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.