dynamic - 具有可变长度的 Char 字段的动态类型定义
问题描述
对于内部使用,我需要定义一个结构化类型,其中一个字段是具有可变长度的字符字段。
像这样的东西(我希望这个例子能澄清我的问题):
DATA: lv_type TYPE char7.
lv_type = 'char128'. "The actual length will be determined during execution of the program
TYPES: BEGIN OF ty_satzcounter,
satza TYPE zedist,
addit TYPE (lv_type), "<----- Something like this (obviously, it doesn't work like
" this, but I think it clarifies my question)
menge TYPE int1,
END OF ty_satzcounter.
DATA: lt_satzcounter TYPE TABLE OF ty_satzcounter,
ls_satzcounter TYPE ty_satzcounter.
...
...
解决方案
这种动态类型是不可能的,但为了您的目的,具有动态长度的字符类型,有以下类型string
:
TYPES: satza TYPE zedist,
addit TYPE string,
...
推荐阅读
- xml - 如何在不输出命名空间的情况下应用需要命名空间的 xsl 转换?
- php - mysql的json输出不正确
- jquery - 在 DataTables 中加载 table.ajax.url 时显示对话框
- python - 有拉取请求冲突问题
- api - 带有 ObservableObject 的 SwiftUI - 包含 NavigationLink 的列表以在滚动时下载它的详细信息不出现
- javascript - 隐藏的日期表单元素无法删除?
- tabs - 如何设置标签 TabStrip 边框底部的样式
- visual-studio-code - 查看文件中的外壳颜色
- android - Android 进程在 Android Studio 3.5 中意外退出
- c# - 异步函数返回 false 但应该返回 true