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

Approximate operator and recursive call function in abap

former_member245036
Participant
0 Likes
472

Dear expert,

Please give me an example about Approximate operator and recursive call function in abap

thanks so much

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
397

Hi

About Approximate operator, you can go to tcode 'ABAPDOCU', searching CO,CN,CA etc...each of them have example there.

And recursive function,

Say here is a FM,

FUNCTION recursive_get_number.

*import im_num type i.

*export ex_num type i.

ex_num = im_num + 1.

IF ex_num GE 100.

   EXIT.

ELSE.

   CALL FUNCTION recursive_get_number

        EXPORTING

           im_num = ex_num

        IMPORTING

           ex_num = ex_num.

ENDIF.

ENDFUNCTION.

When you call this function from outside with importing parameter '1',  then will return you 100.

regards,

Archer.

1 REPLY 1
Read only

Former Member
0 Likes
398

Hi

About Approximate operator, you can go to tcode 'ABAPDOCU', searching CO,CN,CA etc...each of them have example there.

And recursive function,

Say here is a FM,

FUNCTION recursive_get_number.

*import im_num type i.

*export ex_num type i.

ex_num = im_num + 1.

IF ex_num GE 100.

   EXIT.

ELSE.

   CALL FUNCTION recursive_get_number

        EXPORTING

           im_num = ex_num

        IMPORTING

           ex_num = ex_num.

ENDIF.

ENDFUNCTION.

When you call this function from outside with importing parameter '1',  then will return you 100.

regards,

Archer.