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 Syntax Error

Former Member
0 Likes
746

Hello All,

I am recieving a syntax error when performing an extended program check. Basically the field symbol contains two structures which will be passed to a type table gt_list. The Assign statement has been defined incorrectly but the correct information is being passed to the field symbol and gt_list. Below is the code that is in the program:

TYPES: BEGIN OF t_output,

nodes TYPE LINE OF /sapapo/om_io_pp_tab,

schedlines_all TYPE LINE OF /sapapo/vsr_g_funit_tab,

END OF t_output.

DATA: wa_ionodes TYPE /sapapo/om_io_pp.

DATA: gt_list TYPE TABLE OF t_output.

FIELD-SYMBOLS: <fs_output> TYPE t_output.

LOOP AT s_ionodes INTO wa_ionodes WHERE pegid = pegid.

ASSIGN wa_ionodes TO <fs_output>-nodes. <---Syntax Error

APPEND <fs_output> TO gt_list.

ENDLOOP.

Does anyone know how to correct this sytax error? Thanks for your help in advance.

John

6 REPLIES 6
Read only

Former Member
0 Likes
698

John,

Try changing your NODES declaration in t_output to this:

nodes TYPE /sapapo/om_io_pp,

Read only

0 Likes
698

Hello John,

Thanks for your reply. I changed the declaration as suggested, however I still obtain that syntax error in the extended program check. Any further suggestions? Thanks.

John

Read only

0 Likes
698

Which is error occuring?

Max

Read only

0 Likes
698

Hello Max,

This is the error that I am recieveing from the extended program check.

Syntax check warning

"<FS_OUTPUT>-NODES" is not defined as a field symbol.

(The message cannot be hidden using pseudo-comment "#EC .., bzw. durch SET

EXTENDED CHECK OFF/ON)

John

Read only

Former Member
0 Likes
698

Hi

TYPES: BEGIN OF t_output,

<b>nodes TYPE LINE OF /sapapo/om_io_pp_tab,</b>

schedlines_all TYPE LINE OF /sapapo/vsr_g_funit_tab,

END OF t_output.

<b>DATA: wa_ionodes TYPE /sapapo/om_io_pp.</b>

DATA: gt_list TYPE TABLE OF t_output.

FIELD-SYMBOLS: <fs_output> TYPE t_output.

LOOP AT s_ionodes INTO wa_ionodes WHERE pegid = pegid.

ASSIGN wa_ionodes TO <fs_output>-nodes. <---Syntax Error

APPEND <fs_output> TO gt_list.

ENDLOOP.

t_output-nodes and wa_ionodes seem to be defined in different ways, try to use the same definition:

nodes TYPE /sapapo/om_io_pp

or

wa_ionodes TYPE LINE OF /sapapo/om_io_pp_tab

Max

Read only

Former Member
0 Likes
698

Hi John,

Try using LIKE instead of TYPE.

TYPES: BEGIN OF t_output,

nodes <b>LIKE</b> LINE OF /sapapo/om_io_pp_tab,

schedlines_all <b>LIKE</b> LINE OF /sapapo/vsr_g_funit_tab,

END OF t_output.

tables: equi, egerh.

Example code:-

data: i_equi type standard table of equi with header line,

i_egerh type standard table of equi with header line.

TYPES: BEGIN OF t_output,

nodes like line of i_equi,

schedlines_all like line of i_egerh,

END OF t_output.

DATA: wa_ionodes TYPE equi.

DATA: gt_list TYPE TABLE OF t_output.

FIELD-SYMBOLS: <fs_output> TYPE t_output.

select * into table i_equi from equi.

LOOP AT i_equi INTO wa_ionodes WHERE equnr = '123445'.

ASSIGN wa_ionodes TO <fs_output>-nodes.

APPEND <fs_output> TO gt_list.

ENDLOOP.

Regards.