简体   繁体   English

尝试筛选内部表 abap 时出错

[英]Error trying to screen an internal table abap

I´m learning ABAP and I keep trying to write that internal table and show it.我正在学习 ABAP,我一直在尝试编写该内部表并显示它。 There's syntax error message at line WRITE: / I_EJSEIS : WRITE: / I_EJSEIS行有语法错误消息:

"I_EJSEIS" cannot be converted to a character-like value “I_EJSEIS”不能转换为类似字符的值

I just don't understand it.我只是不明白。

TYPES: S_EJSEIS LIKE SPFLI.
DATA: I_EJSEIS  TYPE TABLE OF S_EJSEIS WITH HEADER LINE,
      WA_EJSEIS TYPE S_EJSEIS.


SELECT FLTYPE
  FROM SPFLI
  INTO TABLE I_EJSEIS
  WHERE CARRID = 'LH'.

LOOP AT I_EJSEIS.
  WRITE: / I_EJSEIS.
ENDLOOP.

According to the ABAP documentation of WRITE dobj :根据WRITE dobj的 ABAP 文档:

For dobj, those data types are allowed that are grouped under the generic type simple:对于 dobj,允许分组在泛型简单类型下的那些数据类型:

  • All flat data types;所有平面数据类型; flat structures are handled like a data object of type c and can only contain any character-like components.平面结构像 c 类型的数据对象一样处理,并且只能包含任何类似字符的组件。
  • The data types string and xstring数据类型 string 和 xstring
  • enumerated types;枚举类型; the name (maximum three characters) of the enumerated constant is used in uppercase letters, which defines the current enumerated value.枚举常量的名称(最多三个字符)用大写字母表示,它定义了当前的枚举值。

In your case, I_EJSEIS is a (flat) structure containing at least one non-character component (eg fltime , distance , period ), so it doesn't fall in any of the categories above.在您的情况下, I_EJSEIS是一个(平面)结构,包含至少一个非字符组件(例如fltimedistanceperiod ),因此它不属于上述任何类别。

The workaround is to display the fields individually:解决方法是单独显示字段:

WRITE: / I_EJSEIS-FLTYPE, I_EJSEIS-FLTIME.

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM