2006 Sep 23 8:17 AM
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
2010 Oct 03 1:44 AM
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]
2010 Oct 01 8:16 PM
Yes we can create recursive methods:
Ex.
Method recursive.
......
if .....
recursive( xxx = fyxx
zzz = altzzz ).
endif.
......
endmethod.
2010 Oct 02 10:37 AM
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.
2010 Oct 03 1:44 AM
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]