cancel
Showing results for 
Search instead for 
Did you mean: 

Field routine DATA STATEMENT error

Former Member
0 Kudos

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

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi Diego,

Did u got the solution for above question? I am looking for the same solution. If the above problem solved? please let me know.

RamanKorrapati
Active Contributor
0 Kudos

Hi David,

As my guess yot DATA statement may be placed in wrong area of routine.

so please open new thread and share your code. that would help us to suggest you.

Thanks

Former Member
0 Kudos

Hi Raman,

This is the cod of start routine and field routine to read data from global data structure. please help me in this issue. and let me if its not clear.

Start Routine

------------------------

     Types: begin of itabtype,

job_numb type /bic/oiZjob_no,

stg_numb type /bic/oiZstg_no,

profile type /bic/oiZAGE_PFLE,

tot_days type /bic/oiZTOTL_DAY,

end of itabtype.

data : itab type standard table of itabtype

with key job_numb,

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-jobno to wa_itab-job_numb.

move wa_source_package-stgno to wa_itab-stg_numb.

wa_itab-tot_days = wa_source_package-enddate -

wa_source_package-strtdate.

if wa_itab-tot_days le 10 .

wa_itab-profile = '(0-10)'.

elseif wa_itab-tot_days gt 10 and wa_itab-tot_days le 20.

wa_itab-profile = '(10-20)'.

else.

wa_itab-profile = '(20-NN)'.

endif.

append wa_itab to itab.

endloop.

and FIELD ROUTINE:

--------------------------

read table itab into wa_itab

with key job_num = SOURCE_FIELDS-jobno.

if sy-subrc = 0.

     RESULT = wa_itab-tot_days.

     endif.

-----------------------

ERROR:

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

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

former_member559220
Participant
0 Kudos

Hi DAVID,   The declaration of ITAB will in the global declaration part of start routine otherwise it will show error only.  go to start routine paste below code in between global declaration part.     Types: begin of itabtype,  job_numb type /bic/oiZjob_no,  stg_numb type /bic/oiZstg_no,  profile type /bic/oiZAGE_PFLE,  tot_days type /bic/oiZTOTL_DAY,  end of itabtype.  data : itab type standard table of itabtype  with key job_numb,  wa_itab like line of itab.     Regards, rajagopal.

Former Member
0 Kudos

Hi Gopal

   Thanks for your reply, I declared in global data section. now its clear and no errors.

Thanks,

David

Former Member
0 Kudos

This tread was answered in the previous post.