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

Field Symbol Declaration

Former Member
0 Likes
6,578

Hi experts,

I declared a field symbol in the Global Definition in the Field Symbols tab: <FS_SAVE_SELECTIONS> TYPE FINT_FRANGE_T.

The structure of FINT_FRANGE_T is:

TYPES: BEGIN OF fint_frange_t,

fieldname LIKE rsdstabs-prim_fname,

fieldtype(1) TYPE c,

selopt_t TYPE fint_selopt_t,

END OF fint_frange_t.

In the Initialization tab of Global Definition I have the following code:

CONSTANTS: lc_save_selections(31) TYPE c VALUE '(RFINTITAR)GT_SAVE_SELECTIONS[]'.

ASSIGN (lc_save_selections) TO <fs_save_selections>.

When I execute the program, an runtime error occurs: You attempted to assign a field to a typed field symbol,

but the field does not have the required type.

How do I correct this? Thanks!

Hi experts,

I declared a field symbol in the Global Definition in the Field Symbols tab: <FS_SAVE_SELECTIONS> TYPE FINT_FRANGE_T.

The structure of FINT_FRANGE_T is:

TYPES: BEGIN OF fint_frange_t,

fieldname LIKE rsdstabs-prim_fname,

fieldtype(1) TYPE c,

selopt_t TYPE fint_selopt_t,

END OF fint_frange_t.

In the Initialization tab of Global Definition I have the following code:

CONSTANTS: lc_save_selections(31) TYPE c VALUE '(RFINTITAR)GT_SAVE_SELECTIONS[]'.

ASSIGN (lc_save_selections) TO <fs_save_selections>.

When I execute the program, an runtime error occurs: You attempted to assign a field to a typed field symbol,

but the field does not have the required type.

How do I correct this? Thanks!

8 REPLIES 8
Read only

Former Member
0 Likes
3,150

Hi Marc,

GT_SAVE_SELECTIONS[] is a table, but your field-symbol is a structure.

Try:

field-symbols: <FS_SAVE_SELECTIONS> TYPE STANDARD TABLE OF FINT_FRANGE_T.

Regards,

John.

Read only

Former Member
0 Likes
3,150

hi,

do this way ..


field-symbols : <FS_SAVE_SELECTIONS> TYPE STANDARD TABLE OF FINT_FRANGE_T. 

Read only

Former Member
0 Likes
3,150

add the occurs n addition to your types definition

TYPES: BEGIN OF fint_frange_t OCCURS 10,

fieldname LIKE rsdstabs-prim_fname,

fieldtype(1) TYPE c,

selopt_t TYPE fint_selopt_t,

END OF fint_frange_t.

and see if it works

Read only

0 Likes
3,150

In Smartforms:

When I declare the field symbol in the Global Definition -> Field Symbol tab: <FS_SAVE_SELECTIONS> TYPE STANDARD TABLE OF FINT_FRANGE

An error is occuring: "," exepected after "TABLE".

Read only

Former Member
0 Likes
3,150

Declare

<FS_SAVE_SELECTIONS> TYPE TABLE OF

FINT_FRANGE_T.

As u are accessing a table.

Reward if useful.

Read only

0 Likes
3,150

Hi Swastik,

An error is occuring: "," exepected after "TABLE".

Read only

Former Member
0 Likes
3,150

Hi Marc,

Try this one:

DATA: gv_ref type ref to data.

Field-symbols: <fs> type standard table.

CREATE DATA gv_ref TYPE STANDARD TABLE OF '(RFINTITAR)GT_SAVE_SELECTIONS[]'.

ASSIGN gv_ref->* to <fs>.

I am not sure with this one...

-salem-

Edited by: Salem_ M on May 19, 2008 1:59 PM