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: 

Recursive methods.

Former Member
0 Kudos

Can we create recursive methods in ABAP objects?

Thanks in Advance !!!

Please post your questions in the correct forum.

Edited by: Rob Burbank on Oct 1, 2010 4:55 PM

1 ACCEPTED SOLUTION

GrahamRobbo
Active Contributor
0 Kudos

Hi Rohini,

can I suggest an alternative way to get an answer for a question like this?

Why don't you just try it? It would take you about 2 minutes to have a go and you would learn a whole lot more than just "Yes it can".

Then - if you think the information you have learned is valuable enough - you could add it to the ABAP Wiki for others.

You would then become a SCN Contributor.

Cheers

Graham Robbo

p.s. [http://www.youtube.com/watch?v=_IvtH9hZqEo]

3 REPLIES 3

Former Member
0 Kudos

Yes we can create recursive methods:

Ex.

Method recursive.

......

if .....

recursive( xxx = fyxx

zzz = altzzz ).

endif.

......

endmethod.

Former Member
0 Kudos

Hi,

Yes. We can create recursive methods in ABAP Objects. You need to take care when to come out of the recursion. Otherwise it will lead to indefinite loop.

Mostly, in SAP PP module BOM related programs require recursion.

The program can be like this :

Method RECURSION.

if <condition>.

exit.

else.

call method RECURSION.

endif.

endmethod.

Please let me know if you need assistance further.

Best Regards,

Aleem Mohiuddin.

GrahamRobbo
Active Contributor
0 Kudos

Hi Rohini,

can I suggest an alternative way to get an answer for a question like this?

Why don't you just try it? It would take you about 2 minutes to have a go and you would learn a whole lot more than just "Yes it can".

Then - if you think the information you have learned is valuable enough - you could add it to the ABAP Wiki for others.

You would then become a SCN Contributor.

Cheers

Graham Robbo

p.s. [http://www.youtube.com/watch?v=_IvtH9hZqEo]