Quantcast
Channel: SCN: Message List
Viewing all articles
Browse latest Browse all 9063

Re: Recursion!

$
0
0

Hi Ahmed,

 

A simple recursion example in C, a factorial program of any number.

unsigned int factorial(unsigned int n) {

    if (n == 0) {

        return 1;

    } else {

        return n * factorial(n - 1);

    }

}

 

Neal is right. You can implement the same using FMs / program module / class method, depends on your requirement.

Recursion or recursive loop just a algorithm/concept of repetition of same logic/instruction executed based on certain rule/condition.

For the implementation of recursion, it is very depends to individual case.

 

Can you please tell what you are trying to achieve in SAP using ABAP?

Perhaps we can help further from there if you can tell further more on requirement.

 

Thanks.

 

regards,

Xiang Li


Viewing all articles
Browse latest Browse all 9063

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>