语法错误 "Field "L_TABDEF–智能表单中的 TLTYPE“未知”

Syntax error "Field "L_TABDEF–TLTYPE" is unknown" in Smart Form

我在 SMARTFORMS 的程序行中定义了局部变量,但似乎即使它是在程序行节点中本地声明的,它也看不到变量。

错误如下所示。

Field "L_TABDEF–TLTYPE" is unknown. It is neither in one of the specified tables nor defined by a "DATA" statement. "DATA" state

FIELD-SYMBOLS: <f_tab> TYPE tsftabdef.

DATA: l_tabdef  TYPE  ssftabdef ,    " Work Area for the Table
      t_ltypes  TYPE tsfltype   ,   " Table – Line types
      l_ltypes  TYPE ssfltype   ,     " Work Area for the table
      t_colinfo TYPE tsfcolinfo ,    " Table – Columns
      l_colinfo TYPE ssfcolinfo ,   " Work area for the table
      t_border  TYPE tsfctaba   ,  " Tables – Borders
      l_border  TYPE ssfctaba   .   " Work Area for the border

ASSIGN ('(SAPLSTXBC)TABDEFS') TO <f_tab>.

* Table definition table
LOOP AT <f_tab> INTO l_tabdef.
  LOOP AT l_tabdef–tltype INTO l_ltypes WHERE linetype = 'LINE'.
    LOOP AT l_ltypes–tcolinfo INTO l_colinfo.
      LOOP AT l_colinfo-borders INTO l_border.
        CLEAR l_border-intensity.
        l_border-fillcolor-red = '255'.
        l_border-fillcolor-green = '000'.
        l_border-fillcolor-blue = '000'.
        l_border-fillcolor-used = 'X'.

        l_border-cfillcolor-color  = 'X'.
        l_border-cfillcolor-xred = 'FF'.
        l_border-cfillcolor-xgreen = '00'.
        l_border-cfillcolor-xblue = '00'.

        MODIFY l_colinfo-borders FROM l_border.
      ENDLOOP.
      MODIFY l_ltypes-tcolinfo FROM l_colinfo.
    ENDLOOP.
    MODIFY l_tabdef-tltype FROM l_ltypes.
  ENDLOOP.
  MODIFY <f_tab> FROM l_tabdef.
ENDLOOP.

我在这里错过了什么?

l_tabdef–tltype 中,您被破折号字符弄糊涂了,它实际上是无效的 Unicode 字符 EN DASH U+2013, so it's not recognized as the "structure component selector" (i.e. the dash character U+002D),编译器认为整个名称指的是经典数据对象,而不是结构组件。

错误可能源自您最喜欢的文本处理软件的 copy/paste。

解决方法:请在l_tabdef–tltype中重新输入"-"

PS:感谢您提供此Minimal, Complete, and Verifiable example,否则无法解决问题![​​=15=]