‎2008 Apr 09 6:03 AM
Hi OO ABAP Gurus
Please clear me the Difference between receiving, changing inporting, exporting and returning parameters of a method?
Many thanks in advance
Sandeep Sharma..
‎2008 Apr 09 8:21 AM
Forget what Prasad said - he's not talking about classes, or objects.
It depends on context. For CALLING a method.
Receiving - typed value returned by the method - maximum one of these
Importing - value returned by the method - many possible, all optional
Exporting - value sent to the method - many possible, some optional
Changing - value sent to the method , changed within the method, sent back from method - many possible some optional
For DEFINING a method
Returning - typed value returned to the caller- maximum one of these
Exporting - value sent to the caller - many possible, all optional
Importing - value sent by the caller - many possible, some optional
Changing - value sent by the caller, changed within the method, sent back to caller - many possible some optional
Note - only for returning/receiving must the parameter have a specific type.
See ABAP help for more details.
matt
‎2008 Apr 09 7:57 AM
Hai sandeep,
we are using changing and using when working with subroutines.
Using and changing : Both are same except, the order how they are taking the order of parameters in called subroutine.
In general,
Using: is used in subroutines when input parameter value doesn't change in the called program.
Changing: is used in subroutines when input parameter value does change in the called program and need to update its value in calling programming.
Importing, Exporting,Changing: These are used when working with function modules only.
Importing: To receive the parameter values from driver program
to function module
Exporting: To send the calculated parameter values to driver
program from function module.
Changing: It is used to send the updated parameter values
(Intially receiving from driver program)
from function module to driver program.
If useful, reward points
by
G.V.K.Prasad
Edited by: PRASAD GVK on Apr 9, 2008 8:57 AM
‎2011 Feb 10 9:40 AM
‎2008 Apr 09 8:21 AM
Forget what Prasad said - he's not talking about classes, or objects.
It depends on context. For CALLING a method.
Receiving - typed value returned by the method - maximum one of these
Importing - value returned by the method - many possible, all optional
Exporting - value sent to the method - many possible, some optional
Changing - value sent to the method , changed within the method, sent back from method - many possible some optional
For DEFINING a method
Returning - typed value returned to the caller- maximum one of these
Exporting - value sent to the caller - many possible, all optional
Importing - value sent by the caller - many possible, some optional
Changing - value sent by the caller, changed within the method, sent back to caller - many possible some optional
Note - only for returning/receiving must the parameter have a specific type.
See ABAP help for more details.
matt
‎2008 Apr 09 11:39 AM
Hi Matt
Thanks for the answer..
But still i have one doubt..
As you define
For receiving and returning typed value
for opthers value
Can you please clear me betwee typed value and value
Please provide me a example if possible for you..
Many thanks in advance
‎2008 Apr 09 3:39 PM
For receiving/returning you can't use a generic type, such as: ANY, ANY TABLE, STANDARD TABLE, CLIKE, NUMERIC.
You have to use a specific type:
an ABAP type (e.g. I, C, string),
a type defined in the data dictionary (a view, a database table, a data type ) e.g. T100, S38E
a type REF TO DATA
type REF TO some other class or interface
another class's public type, e.g. ZCL_MYCLASS=>PUBLIC_TYPE
a type defined with the type section of the class itself.
The point is that the type of the receiving/returning parameter must be known at compile time. For the other parameter types, it can be determined at runtime as well.
matt
‎2011 Feb 12 5:37 PM
Hi,
When we define a Method, we can use following for Formal Parameters-
1- IMPORTING-for Input Formal Parameter
2-EXPORTING-for output Formal Parameter
3-CHANGING-for Input/outputt Formal Parameter
4-RETURNING-for outputt Parameter, passed by value only, and used with a Functional Method
When we call a Method, RECEIVING is used for Actual Parameter to receive the return value of Method in data object.
Thanks,
CP
‎2011 Feb 12 7:43 PM
Hi sandeep,
you should post a question after reading the [documentation|http://help.sap.com/abapdocu_702/en/abapcall_method_parameters.htm].
Regards,
Clemens
‎2012 Feb 02 5:57 AM
As per i have seen:
Importing parameters can be optional or non-optional.
Exporting parameters can be optional or non-optional.
Changing parameters can be optional or non-optional.
But,
Returning Parameter is always optional by default.
Regards,
Pranoy
Edited by: Pranoy on Feb 2, 2012 6:57 AM
‎2012 Feb 20 4:52 AM
Hi Experts,
Can i use changing parameter (in ooabap) to pass and receive the values at the same time for a mathod?
Moderator message: Please don't post a question on an old thread.
Edited by: Neil Gardiner on Feb 20, 2012 4:18 PM