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

Submit command?

Former Member
0 Likes
610

Hi..

Can I submit the same program inside a program?

Can I call the same subroutine inside a subroutine ?

and

Can I call the same FM inside a FM?

Please give me reasons also.

Thank You

6 REPLIES 6
Read only

Former Member
0 Likes
580

All this things are possible.

Read only

Former Member
0 Likes
580

Yes you can do that.

There is no reason but just the business logic implementation.

Regards

Nishant

Message was edited by: Nishant Rustagi

Read only

Former Member
0 Likes
580

Hi

Regarding calling same sub-routine inside the sub-routine and similarly with FM...the answer is yes.

But, there should be a <b>termination condition well defined</b>, so that, it doesnt go into a infinite loop...

Regards,

Raj

Read only

Former Member
0 Likes
580

yes, theoritically its allowed.but practically Its not allowed to write it.

but how you will come out of that ?? if for any case,its not able to come out your program will go to a TIME OUT dump.so you should well define your code in such a case.

but personally i feel we have to avoid that,instead you can think of other alternatives.

regards

srikanth

Message was edited by: Srikanth Kidambi

Read only

Former Member
0 Likes
580

Hello Subhash,

Yes, you can do the below but you need to be very careful about it as it might just end up in a infinite loop ...where you just keep on calling the ABAP/Routine/FM again and again !!

Just for information this type of nesting is called circular reference.

Regards

Anurag

Message was edited by: Anurag Bankley

Read only

Former Member
0 Likes
580

Hi,

Function called itself is recursive in nature and

needs exit condition.

subroutine and submit can be called within same

perform and program but it may give rise to

lot of inconsistency and short dump.

Regards

Amole