Application Development 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: 

field symbols

Former Member
0 Kudos

hi i need a small clarification.

i declared field symbols as below.

field-symbols <fs_sample> type any.

data:it_vbak type hashed table of vbak with unique key vbeln.

data:it_obj type ref to data.

create object it_obj type it_vbak(or some type).

assign it_obj ->* <fs_sample>.

loop at it_vbak into <fs_sample>.

do some operation on field symbol for vbeln.

modify table it_vbak from <fs_sampe> transporting vbeln.

endloop.

here the subrc is getting as 4.

when remove the code

create object it_obj type it_vbak(or some type).

assign it_obj ->* <fs_sample>.

and change the assigninment like below

loop at it_vbak assigning <fs_sample>.

do some operation on field symbol for vbeln.

modify table it_vbak from <fs_sampe> transporting vbeln.

endloop.

it is working fine.

what is the difference b/w these two and y it is not getting updated in first case.please let me know.......

3 REPLIES 3

former_member194669
Active Contributor
0 Kudos

Hi,

INTO used for move the values to work areas,


loop at it_vbak into <fs_sample>.

but for fields symbols you need to use


loop at it_vbak assigning <fs_sample>

0 Kudos

hi it can be done by using <b>into</b> also if we assign the field symbol b4 with the same type.it is not an issue,syntatically it is perfect.please advice if you have more on this

0 Kudos

Hi,

This is simple documentation related to assign.

+

Assigns the field f to the field symbol are compatible when you make the assignment.

+