Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

Setting a default value for a returning variable

former_member333493
Participant
0 Kudos

I have a public static method in my class which returns a variable of type BOOLE_D. Once I save the method parameters, I'm unable to set a default value as that column gets greyed out. Why does this happen? Does it have something to do with returning value automatically being pass-by-value?

1 ACCEPTED SOLUTION

Default values are only available for "Importing" parameters.

Just assign the default value for "Returning" parameter in the first line of code for your method.

https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-us/abapclass-methods_general.htm

Viktor

3 REPLIES 3

Default values are only available for "Importing" parameters.

Just assign the default value for "Returning" parameter in the first line of code for your method.

https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-us/abapclass-methods_general.htm

Viktor

RAF
Active Contributor
0 Kudos

Hi,

if you want a default start your method implementation with

rv_variable = abap_true

for example

RAF
Active Contributor
0 Kudos

Hi,

if you want a default start your method implementation with

rv_variable = abap_true

for example