Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Your offset is not numeric

Former Member
0 Likes
781

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!

1 ACCEPTED SOLUTION
Read only

0 Likes
628

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.

1 REPLY 1
Read only

0 Likes
629

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.