2015 Apr 28 10:00 AM
Hi guys,
I am trying to use an offset with an auxiliar variable, but SAP says me that it is not numeric.
I have this statement:
Data l_tamanoPrefijo type i value 1.
and in the code, i put this implementation:
CONDENSE g_cadena NO-GAPS.
SPLIT g_cadena at '_' into l_prefijo l_palabras.
l_tamanoPrefijo = strlen( l_prefijo ).
READ TABLE gt_ztotule02 WITH KEY prefijo+0(l_tamanoPrefijo) = l_prefijo+0(l_tamanoPrefijo).
But ABAP show me and error, i dont understand what happen.
Please, help me!
2015 Apr 28 10:15 AM
Hi Marta,
In READ TABLE statement you should not write the field name as offset.
Instead of this :-
READ TABLE gt_ztotule02 WITH KEY prefijo+0(l_tamanoPrefijo) = l_prefijo+0(l_tamanoPrefijo).
Write like this :-
READ TABLE gt_ztotule02 WITH KEY prefijo = l_prefijo+0(l_tamanoPrefijo).
regards,
Swaroop.
2015 Apr 28 10:15 AM
Hi Marta,
In READ TABLE statement you should not write the field name as offset.
Instead of this :-
READ TABLE gt_ztotule02 WITH KEY prefijo+0(l_tamanoPrefijo) = l_prefijo+0(l_tamanoPrefijo).
Write like this :-
READ TABLE gt_ztotule02 WITH KEY prefijo = l_prefijo+0(l_tamanoPrefijo).
regards,
Swaroop.