在ABAP中如何使用screen-name值来检查一个结构体的字段?
In ABAP How to use the screen-name value to check a field of a structure?
我已经在 ABAP 中为新的信息类型创建了一个屏幕,
在程序内部,我正在执行 loop screen
以获得不同的值,但最重要的是了解屏幕名称
值内的字段值
一个例子是
screen-name = 'table-field'
valuefield = screen-name.
**if valuefield is initial.
...
endif.**
我怎样才能做到这一点!
非常感谢您的帮助...
您可以使用 FIELD-SYMBOLS
动态访问屏幕值
screen-name = 'table-field'.
assign (screen-name) to FIELD-SYMBOL(<fs>).
" you must check if the assignement has been done successfully
" before accessing the content
if sy-subrc = 0 and <fs> is initial.
endif.
如果您的 ABAP 版本不允许内联声明,您可以考虑这样做:
screen-name = 'table-field'.
FIELD-SYMBOLS <fs> type any.
assign (screen-name) to <fs>.
if sy-subrc = 0 and <fs> is initial.
endif.
我已经在 ABAP 中为新的信息类型创建了一个屏幕,
在程序内部,我正在执行 loop screen
以获得不同的值,但最重要的是了解屏幕名称
一个例子是
screen-name = 'table-field'
valuefield = screen-name.
**if valuefield is initial.
...
endif.**
我怎样才能做到这一点!
非常感谢您的帮助...
您可以使用 FIELD-SYMBOLS
screen-name = 'table-field'.
assign (screen-name) to FIELD-SYMBOL(<fs>).
" you must check if the assignement has been done successfully
" before accessing the content
if sy-subrc = 0 and <fs> is initial.
endif.
如果您的 ABAP 版本不允许内联声明,您可以考虑这样做:
screen-name = 'table-field'.
FIELD-SYMBOLS <fs> type any.
assign (screen-name) to <fs>.
if sy-subrc = 0 and <fs> is initial.
endif.