2

I'm wondering about the definition of a call-by-value EXPORTING argument of an ABAP method call.

The SAP Help Portal states that EXPORTING parameters can be defined call-by-value (and call by reference). It does not give a precise definition of how this parameter type is handled. Instead, it states

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

Now, the ABAP Keyword Documentation of the SAP editor does not mention pass-by-value for EXPORTING. (It does mention pass-by-value for IMPORTING and CHANGING).

I can guess the meaning of pass-by-value EXPORTING. But I want to read the definition. From FORM/PERFORM, I know that details can be subtle. Could you point me to an official description of this case?

1
  • 1
    Well, the ABAP reference states "When called, either a reference to an actual parameter is passed, [...] depending on the passing type. Maybe that could count as an answer. Commented Apr 28, 2015 at 7:43

1 Answer 1

2

I'm not sure in what way the details can be subtle even when using FORMs - but anyway, it's in 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.
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.