‎2006 Oct 25 3:32 PM
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
‎2006 Oct 25 3:45 PM
John,
Try changing your NODES declaration in t_output to this:
nodes TYPE /sapapo/om_io_pp,
‎2006 Oct 25 3:50 PM
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
‎2006 Oct 25 4:34 PM
‎2006 Oct 25 4:46 PM
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
‎2006 Oct 25 3:49 PM
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
‎2006 Oct 25 4:06 PM
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.