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 problem

Former Member
0 Likes
836

Hello !

I have a problem and can solve it.

I am calling within a Function Module a badi and calling the same Function Module

again within this badi beacuse I need it. And now I have big recursive loop with no ending.

How can I process to avoid this circultance ?

Regards

Erdem Sas

1 ACCEPTED SOLUTION
Read only

matt
Active Contributor
0 Likes
764

Change your logic. With any recursion, there has to come a point when you don't call the function again. Otherwise, your program simple resolves to:

DO.
ENDDO.

As you so often do, you've not given sufficient information for meaningful answers.

matt

4 REPLIES 4
Read only

Former Member
0 Likes
764

You have to code an exit point when the recursion is complete.

Rob

Read only

matt
Active Contributor
0 Likes
765

Change your logic. With any recursion, there has to come a point when you don't call the function again. Otherwise, your program simple resolves to:

DO.
ENDDO.

As you so often do, you've not given sufficient information for meaningful answers.

matt

Read only

Former Member
0 Likes
764

do you mean extension point ?

If so why and where exactly ?

@MAtt

What makes do enddo .....

Do

Endo

regards

sas

Read only

Former Member
0 Likes
764

More like:

FORM recursion
  USING a
  CHANGING b.

* Use a to get next b
* If it's what you want.
*   Exit.
* Else.
*   perform recursion
*     using b
*     changing c
*
ENDFORM.                               " recursion

Rob

Edited by: Rob Burbank on Nov 3, 2008 2:33 PM

Since this is referenced in the Coffee Corner, I cleaned it up