Application Development and Automation 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: 
Read only

Recursive methods.

Former Member
0 Likes
1,850

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
Read only

GrahamRobbo
SAP Mentor
SAP Mentor
0 Likes
908

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
Read only

Former Member
0 Likes
908

Yes we can create recursive methods:

Ex.

Method recursive.

......

if .....

recursive( xxx = fyxx

zzz = altzzz ).

endif.

......

endmethod.

Read only

Former Member
0 Likes
908

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.

Read only

GrahamRobbo
SAP Mentor
SAP Mentor
0 Likes
909

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]