cancel
Showing results for 
Search instead for 
Did you mean: 

Start routine spelling errors

Former Member
0 Kudos

Hi,

I'm trying to write a start routine in BW in order to:

Get an internal table from an ODS table with same structure, containing the fields 'incidencia', 'criticidad', horas' .

Fill the internal table.

Make a loop at that internal table and make a sustraction depending on diferent if statements. After that append to internal table.

The thing is i'm having diferent spelling errors that i cannot solve by myself. Can anybody help me with this 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

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi there,

you don't have spelling errors. You have sysntax errors.

From the code you posted I can see the following:



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.

you're missing here another elseif

Insert this right here:


elseif


 
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.


Hope this helps,

Regards,

Diogo.

Former Member
0 Kudos

Hi Diogo,

Now i´m getting the following error:

E:Statement "WA_ITAB-DIFHORAS" is not defined. Check your spelling.

Former Member
0 Kudos

Hi there,

Yes you are.

On the last part of your code:



else.
 
wa_itab-difhoras EQ ''.
 
endif.

you sould replace


wa_itab-difhoras EQ ''.

by this:


clear wa_itab-difhoras.

Try it.

Hope this helps,

Regards,

Diogo.

Former Member
0 Kudos

Thank you very much Diogo. Replacing that line the problem was solved.

Former Member
0 Kudos

Hi,

Now I´m having a problem trying to read the start routine i created 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.

read table itab into wa_itab

       with key incidencia = SOURCE_FIELDS-/BIC/OIZNROINC.

    if sy-subrc = 0.

      RESULT = wa_itab-difhoras.

    endif.

Thanks,

Diego

Former Member
0 Kudos

Hi there,

In your previsou code, you should have defined your variables on the global part.

Go to your start routine and cut the definition of the table and insert it on the global part:

Cut this from the start routine and insert it on the global part:


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.

Then you should have no issues on the field definition.

Hope this helps,

Regards,

Diogo.

Former Member
0 Kudos

Thanks. Now I don´t have any errors.

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi

What exactly you mean by spelling error?

whats error message you are getting?

Regards

Sudeep

Former Member
0 Kudos

E:Statement "WA_ITAB-CRITICIDAD" is not defined. Check your spelling.