Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

Relational operator "-" is not supported

Former Member
0 Kudos

Deal all,

Here is the code that has error.

>>> > IF ( NO_DK - CO_DK + PS_NO - PS_CO ) < 0.

>>> NO_CK = NO_CK + ( NO_DK - CO_DK + PS_NO - PS_CO ).

>>> ENDIF.

Pls help me to check and correct it.

Thanks,

Quanglv

3 REPLIES 3

SuhaSaha
Advisor
Advisor
0 Kudos

This is pretty basic Prior to SAPNW7.0 EhP2 you can't use a formula after IF statement. You've to define a dummy variable, pass result of the formula to it & use the dummy variable in the IF clause.

V_DUMMY = NO_DK - CO_DK + PS_NO - PS_CO.

IF V_DUMMY < 0. "( NO_DK - CO_DK + PS_NO - PS_CO ) < 0.
NO_CK = NO_CK + ( NO_DK - CO_DK + PS_NO - PS_CO ).
ENDIF.

Check this blog by Thomas Weiss on the new features in SAPNW7.0 EhP2: [http://www.sdn.sap.com/irj/scn/weblogs?blog=/pub/wlg/18115] [original link is broken] [original link is broken] [original link is broken];

BR,

SUhas

Edited by: Suhas Saha on Aug 27, 2010 9:11 AM

Former Member
0 Kudos

Hi,

Try to put condition


NO_DK - CO_DK + PS_NO - PS_CO

into another variable then compare with zero.

regards,

Former Member
0 Kudos

DATA : NO_DK TYPE N,

CO_DK TYPE N,

PS_NO TYPE N,

PS_CO TYPE N,

NO_CK TYPE N,

VAR TYPE N.

VAR = NO_DK - CO_DK + PS_NO - PS_CO.

IF VAR < 0.

NO_CK = NO_CK + ( NO_DK - CO_DK + PS_NO - PS_CO ).

ENDIF.