08-27-2010 4:13 AM
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
08-27-2010 4:35 AM
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
08-27-2010 4:35 AM
Hi,
Try to put condition
NO_DK - CO_DK + PS_NO - PS_CO
into another variable then compare with zero.
regards,
08-27-2010 4:54 AM
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.