无法识别内联声明的变量
我遇到一个问题,系统无法识别我声明的局部变量。代码如下:
DATA(lv_dmbtr) = ZSD_LGS-DMBTR.
IF ( lv_dmbtr MOD 10000000 ) LE 9.
lv_dmbtr / 10000000 = lv_tenmillions. //Error line
lv_tenmillions_check = lv_tenmillions MOD 1.
IF lv_tenmillions_check > 0.
"Convert
ENDIF.
IF lv_tenmillions_check < 0.
"ZERO
ENDIF.
ENDIF.
该程序在我在程序中输入的行中给出了一个错误,其中显示“没有 LV_DMBTR 语句。请检查拼写。
”知道问题可能出在哪里吗?
提前谢谢大家!
I am having a problem where the system does not recognize a local variable that I have declared. The code is as follows:
DATA(lv_dmbtr) = ZSD_LGS-DMBTR.
IF ( lv_dmbtr MOD 10000000 ) LE 9.
lv_dmbtr / 10000000 = lv_tenmillions. //Error line
lv_tenmillions_check = lv_tenmillions MOD 1.
IF lv_tenmillions_check > 0.
"Convert
ENDIF.
IF lv_tenmillions_check < 0.
"ZERO
ENDIF.
ENDIF.
The program gives me an error in the line that I have input in the program, where it says "There is no LV_DMBTR statement. Please check the spelling."
May anyone of you know where the problem may be?
Thank you all in advance!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
该行在
语法上确实不正确。我和 ABAP 解释器一样对这行代码感到困惑。所以我不确定你到底想用它来完成什么。但我猜测这似乎是对某个变量的某种计算赋值。在赋值中,分配给的变量始终位于
=
符号的左侧,而创建值的表达式位于右侧=
符号的 >。因此,等号左边有一个数学公式是没有意义的。
要么你想说“lv_tenmillion 应为 lv_dmbtr 除以 10000000”。在这种情况下,正确的行是
或者您试图说“lv_dmbtr 的百万分之一应等于 lv_tenmillion”,这相当于说“lv_dmbtr 应等于 lv_tenmillion 乘以 10000000”或
The line
is indeed not syntactically correct. I am as confused by that line as the ABAP interpreter. So I am not sure what exactly you are trying to accomplish with it. But I would guess that it seems to be some kind of assignment of a computation to some variable. In an assignment, the variable you assign to is always on the left of the
=
sign, while the expression which creates the value is on the right of the=
sign.So having a mathematical formula on the left-hand side of an equal sign makes no sense.
Either you are trying to say "lv_tenmillion shall be lv_dmbtr divided by 10000000". In that case the correct line would be
Or you are trying to say "one millionth of lv_dmbtr shall be equal to lv_tenmillion" which would be equivalent to saying "lv_dmbtr shall be equal to lv_tenmillion multiplied by 10000000" or
试试这个:
Try this: