如何将以下全局变量中包含的值识别为lv_local
变量?
data lv_local type string.
lv_local = '(SAPLMIGO)LCL_MIGO_GLOBALS=>KERNEL->S_CONTROL-VGART'.
答案 0 :(得分:2)
您可以将变量分配给字段符号并从中读取值。 示例:
CONSTANTS:
lco_migo_vgart_path TYPE string VALUE '(SAPLMIGO)LCL_MIGO_GLOBALS=>KERNEL->S_CONTROL-VGART'.
FIELD-SYMBOLS:
<migo_vgart> TYPE any.
DATA:
lv_vgart TYPE vgart.
ASSIGN (lco_migo_vgart_path) to <migo_vgart>.
IF sy-subrc = 0.
lv_vgart = <migo_vgart>.
ENDIF.
请注意,从这样的调用堆栈访问变量对于生产用途而言并不理想,因此强烈建议寻找替代实现。