从ABAP SAP中的表或结构中获取字段
如果需要标识结构中的字段和字段数,则应使用运行时类型服务。在这种情况下,使用运行时类型服务更有意义,就好像我们的环境中有一些数据一样,那么调用数据库来获取数据并不是理想的选择。
DATA(structure) = VALUE <your structure>( )
DATA(Descriptor) = CAST cl_abap_structdescr( cl_abap_datadescr=>describe_by_data
(structure) )
DATA(Fields = LINES(Descriptor ->components )这将为您提供表或结构的组件数。
如果您不想使用运行时类型服务,也可以尝试其他选项。下面的查询可以让你成为计数
SELECT COUNT(*) INTO @data(count)
FROM DD03l (// this table stores the fields information of SAP tables)
WHERE tabname = <Structure name>
AND AS4LOCAL = 'A'热门推荐
1 狗狗下楼训练
3 狗狗训练头盔
6 狗狗训练机构
7 训练狗狗步骤
9 狗狗能训练
10 狗狗基本动作训练方法
11 怎么训练狗狗叼饭盆
12 狗狗一岁了还能训练吗
13 训练狗狗的
14 宁波狗狗训练
15 训练狗狗拉屎
16 教狗狗训练
17 狗狗要怎么训练上厕所
18 狗狗靠的训练