cancel
Showing results for 
Search instead for 
Did you mean: 

Field routine error E:Relational operator "AND" is not supported.

Former Member
0 Kudos

Hi,

I wrote the following field routine and i have the following error with the the logical expressions OR / AND:

E:Relational operator "AND" is not supported.

Can anybody help me with this?

DATA v_hsme type i.
    DATA v_totalinc type i.
    DATA v_hsme type i.
    DATA ROWCOUNT type i.

    describe table itab lines ROWCOUNT.

    read table itab into wa_itab

               with key incidencia = SOURCE_FIELDS-NROINCIDENCIA.

    clear v_hsme.
    clear v_hsba.
    clear v_hsmb.
    clear v_totalinc.

    If wa_itab-criticidad EQ 'Media' OR 'Baja'

    AND wa_itab-difhoras NE ''.

      v_hsme = 1.

      v_totalinc = rowcount.
   
      RESULT = v_hsme / v_totalinc.

    endif.

Regards,

Diego

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi there,

You're using your operations incorrectly.

Use this instead:


DATA v_hsme type i.
    DATA v_totalinc type i.
    DATA v_hsme type i.
    DATA ROWCOUNT type i.
 
    describe table itab lines ROWCOUNT.
 
    read table itab into wa_itab
 
               with key incidencia = SOURCE_FIELDS-NROINCIDENCIA.
 
    clear v_hsme.
    clear v_hsba.
    clear v_hsmb.
    clear v_totalinc.
 
    If ( wa_itab-criticidad EQ 'Media' OR wa_itab-criticidad EQ 'Baja' ) 
    AND wa_itab-difhoras NE ''.
 
      v_hsme = 1.
 
      v_totalinc = rowcount.
   
      RESULT = v_hsme / v_totalinc.
 
    endif.

Hope this helps,

Regards,

Diogo.

Former Member
0 Kudos

Problem solved.

O brigado,

Diego

Former Member
0 Kudos

De nada (You're welcome)

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi,

Change your code part as:

If wa_itab-criticidad EQ 'Media' OR 'Baja'
 
    AND wa_itab-difhoras NE ''.

--->>>

If ( wa_itab-criticidad EQ 'Media' OR  wa_itab-criticidad EQ 'Baja' ) 
AND 
( wa_itab-difhoras NE '' ) .