abap - EXPORTING方法参数如何按值传递?

标签 abap method-call call-by-value

我想知道 ABAP 方法调用的按值调用 EXPORTING 参数的定义。

SAP Help Portal 指出 EXPORTING 参数可以按值调用(以及按引用调用)进行定义。它没有给出如何处理此参数类型的精确定义。相反,它指出

For precise details of the relevant ABAP statements, refer to the corresponding keyword documentation in the ABAP Editor.

现在,SAP 编辑器的 ABAP 关键字文档没有提及 EXPORTING 的按值传递。 (它确实提到了导入和更改的值传递)。

我可以猜出传值导出的含义。但我想读一下定义。从 FORM/PERFORM 中,我知道细节可能很微妙。您能给我提供有关此案例的官方描述吗?

最佳答案

我不确定即使使用 FORM 时细节也会以何种方式变得微妙 - 但无论如何,它在 the documentation:

There are two ways in which parameters can be passed: pass by reference and pass by value. Pass by value is selected in the Function Builder by selecting pass by value, and in the above syntax, differs from pass by reference by the specification of VALUE( ).

  • In pass by reference, the formal parameter points directly to the actual parameter, so that changes to the formal parameters have an
    immediate effect on the actual parameter.
  • In pass by value, when the function module is called, the formal parameter is created as a copy of the actual parameter (in IMPORTING and CHANGING parameters), or initial (in EXPORTING parameters) in the stack. In CHANGING and EXPORTING parameters, the formal parameter is copied to the actual parameter when returning from the function module.

关于abap - EXPORTING方法参数如何按值传递?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29912443/

相关文章:

dynamic - RFC_READ_TABLE 示例将数据转换回表

abap - 滚动时固定文本

java - 赋值的左侧必须是变量

javascript - TypeScript 引用调用困惑

scala - 在 Scala 中,什么时候是使用惰性求值参数而不是使用函数作为参数的好时机?

oop - 方法调用作为另一个方法调用的参数?

abap - 2个时间戳之间的差异

java - 检查返回值是否不为空,如果是,则在一行中使用一个方法调用将其分配

javascript - 从本地 JavaScript 应用程序调用 Python 脚本

java - 将 Java 对象实例化为传递的对象引用