Skip to Content
0
Former Member
Mar 03, 2011 at 03:04 PM

Field routine DATA STATEMENT error

272 Views

Hi,

I´m having the following error trying to read the start routine i created (attached below) trough a field routine where i want to insert the result:

E:Field "ITAB" is unknown. It is neither in one of the specified tables

nor defined by a "DATA" statement. "DATA" statement.

I really don´t figure it out what i´m missing here. Can anybody help me with this?

read table itab into wa_itab
 
       with key incidencia = SOURCE_FIELDS-/BIC/OIZNROINC.
 
    if sy-subrc = 0.
 
      RESULT = wa_itab-difhoras.
 
    endif.

START ROUTINE:

Types: begin of itabtype,

incidencia type /BIC/OIZNROINC,
criticidad type /BIC/OIZCRITIC,
horas type /BIC/OIZQHORAS,
difhoras type /BIC/OIZDIFHS,

END OF itabtype.


data : itab type standard table of itabtype
with key incidencia,
wa_itab like line of itab.


DATA: wa_SOURCE_PACKAGE type _ty_s_SC_1.


Loop at SOURCE_PACKAGE into wa_SOURCE_PACKAGE.

move wa_SOURCE_PACKAGE-/BIC/ZNROINC to wa_itab-incidencia.
move wa_SOURCE_PACKAGE-/BIC/ZCRITIC to wa_itab-criticidad.
move wa_SOURCE_PACKAGE-/BIC/ZQHORAS to wa_itab-horas.
move wa_SOURCE_PACKAGE-/BIC/ZDIFHS to wa_itab-difhoras.

If wa_itab-criticidad EQ 'Alta' and wa_itab-horas GE 8.

wa_itab-difhoras = wa_itab-horas - 8.

elseif

wa_itab-criticidad EQ 'Media' and wa_itab-horas GE 12.

wa_itab-difhoras = wa_itab-horas - 12.


wa_itab-criticidad EQ 'Baja' and wa_itab-horas GE 12.

wa_itab-difhoras = wa_itab-horas - 12.

else.

wa_itab-difhoras EQ ''.

endif.


append wa_itab to itab.

endloop.

Thanks,

Diego

Edited by: OB1 on Mar 3, 2011 1:04 PM