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

Looping a Field symbol.

ramiwal_dsilva
Participant
0 Likes
3,638

Hi,

Can someone explain what to me what the following statement means?

Data: i_tab  TYPE STANDARD TABLE.

I looked it up and and it says that it is an ABAP built in type which is generic, but i fail to understand its usage.

And here is my scenario.

Field-symbols: <IT_DETAILS >  TYPE STANDARD TABLE,

                      <lines>                TYPE  (Transparent dictionary table)

LOOP AT <lt_details> ASSIGNING <lines>.

move <lines>-field to l_variable.

Endloop

Upon execution, I get a dump at the Loop statement saying that there is an 'ASSIGN_TYPE_CONFLICT'.You attempted to assign a field to a typed field symbol,but the field does not have the required type.

How to correct the error

    Adapt the type of the field symbol to the type of the field or use an

    untyped field symbol or use the "CASTING" addition.

Can someone explain the correct way to type the field symbol and implement the loop construct?

Any help will be highly appreciated

3 REPLIES 3
Read only

Former Member
0 Likes
984

Hello,

Can you tell us the type of the variable l_variable?


Example:

FIELD-SYMBOLS:    <pos_data> TYPE ANY,

                               <gt_pos_data>  TYPE table.

  DATA : lt_csks LIKE gt_csks WITH HEADER LINE.

LOOP AT <gt_pos_data> ASSIGNING <pos_data>.

    MOVE-CORRESPONDING <pos_data> TO lt_csks.

  

  ENDLOOP.

Read only

SimoneMilesi
Active Contributor
0 Likes
984

check here

Read only

VenkatRamesh_V
Active Contributor
0 Likes
984

Hi Ramiwal,

Delcare.

FIELD-SYMBOLS: <table> TYPE ANY TABLE.



Regards,

Venkat.