ASSIGN 因调试器路径中的变量而失败 [英] ASSIGN fails with variable from debugger path

查看:32
本文介绍了ASSIGN 因调试器路径中的变量而失败的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图将这个结构路径的值分配给一个字段符号,但是这个路径不起作用,因为它的路径中有一个表.

I am trying to assign the value of this stucture path to a fieldsymbol, but this path does not work because it has a table in it's path.

但在调试器中,此路径的值显示正确.

But with in the debugger this value of this path is shown correctly.

有没有办法通过传递一个路径将表格行的组件动态分配给字段符号?如果没有,那么我将只读取表格行,然后使用路径来获取所需的值.

Is there a way to dynamically assign a component of a table line to a fieldsymbol, by passing one path? If not then I will just read the table line and then use the path to get the wanted value.

ls_struct (Struct)
    - SUPPLYCHAINTRADETRANSACTION (Struct)
        - INCL_SUPP_CHAIN_ITEM (Table)
            - ASSOCIATEDDOCUMENTLINEDOCUMENT (Element)   


i_component_path = |IG_DDIC-SUPPLYCHAINTRADETRANSACTION-INCL_SUPP_CHAIN_ITEM[1]-ASSOCIATEDDOCUMENTLINEDOCUMENT|.
ASSIGN (i_component_path) TO FIELD-SYMBOL(<lg_value>).
IF <lg_value> IS NOT ASSIGNED.
    return.
ENDIF.

<lg_value> won't be assigned 

推荐答案

Solution by Sandra Rossi

Solution by Sandra Rossi

调试器有自己的语法和逻辑,它根本不应用ASSIGN 算法.使用ABAP源代码,你必须使用两次ASSIGN,第一次到达内表,然后你选择第一行,第二次到达该行的组件.

The debugger has its own syntax and own logic, it doesn't apply the ASSIGN algorithm at all. With ABAP source code, you have to use ASSIGN twice, the first one to reach the internal table, then you select the first line, and the second one to reach the component of the line.

调试器的工作方式完全不同,调试器代码只在调试模式下工作,你不能从调试器调用代码(即如果你调用它,调试器使用的内核代码将失败).不,没有abappath".有 XSL 转换对象 (xpath),但对于您的要求来说它很慢.

The debugger works completely differently, the debugger code works only in debug mode, you can't call the code from the debugger (i.e. if you call it, the kernel code used by the debugger will fail). No, there's no "abappath". There are the XSL transformation objects (xpath), but it's slow for what you ask.

非常感谢

这篇关于ASSIGN 因调试器路径中的变量而失败的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆