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

function module vs loacal subroutines

Former Member
0 Likes
515

Hi all,

I have created some six function modules for data migration.all are working fine.

but if i utillized local subroutine for the same logic

it creates performance issue.actually performance for the local subroutine is far better than (1/12) than function module.i checked all coding in both routines .everything is correct.

then what could be the problem.if u know the answer please let me know.

regards,

raja

3 REPLIES 3
Read only

naimesh_patel
Active Contributor
0 Likes
481

Hello,

Whenever you use any FM, system allocates the memory for all the FMs in that function group. SO, it may be the reason for slow access.

Regards,

Naimesh

Read only

Former Member
0 Likes
481

While using subroutines

the whole of program code is loaded in to memory

but while using function modules

only when the call happends the FM and its group is loaded in to memory

that could be a reason for performance drop..

use SE30 and try analysing the code for performance u will get to know

Harish

Read only

Former Member
0 Likes
481

Hi,

Whenever a function module is called there is a process called context switch happens in micro-processor.

In this process all the registers(local memory of microprocessor ), program counter and memory(here cache and RAM) is refreshed and reloaded and previous content is saved in memory location. This whole process takes time. Thats why we have performance issue here.

So direct line of code is faster that local sub-routine . and local sub-routine is faster than function module.

Regards,

Sumit.