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 symbol type incompatible

Former Member
0 Kudos
2,585

I am trying to assign a field symbol to an internal table and i get the errr of type incompatble, even though the table and field symbol are both typed the same. I am not all that familiar with the rules of using field symbols. The code is:

TYPES: BEGIN OF rep_type,

buyer TYPE marc-ekgrp,

del_time TYPE marc-plifz,

mrp_cont TYPE marc-bearz,

mrp_type TYPE marc-dismm,

mat_grp TYPE mara-matkl,

proc_time TYPE marc-bearz,

plan_time TYPE marc-fxhor,

cov_profile TYPE marc-rwpro,

saf_stock TYPE marc-eisbe,

END OF rep_type.

DATA: rep_tab TYPE STANDARD TABLE OF rep_type.

FIELD-SYMBOLS: <rep_ref> TYPE rep_type.

...

ASSIGN rep_tab TO <rep_ref>.

The error is rep_tab and <rep_ref> are type incompatible.

Is there something more about typing with field symbols that I am missing?

1 ACCEPTED SOLUTION

Former Member
0 Kudos
408

rep_tab is a table.

<rep_ref> is referenced to a structure.

Rob

3 REPLIES 3

Former Member
0 Kudos
409

rep_tab is a table.

<rep_ref> is referenced to a structure.

Rob

former_member214857
Contributor
0 Kudos
408

Hi

For this you can define Field symbol as :

DATA: <FS> TYPE ANY TABLE.

Best regards

0 Kudos
408

Use

ASSIGN rep_type TO <rep_ref>.

assign structure rep_type to field symbol.