‎2006 Nov 23 7:26 AM
Hi,
Can we call a Function Module within a loop . Does it reduces the performance.
Can you please guide regarding this.
With Best Regards
Mamatha.
‎2006 Nov 23 7:27 AM
Yes we can call. But it depends on the requirement.Performance is not a major compared to the requirement needed.
loop at it_tab into wa_tab.
call function 'CONVERSION_EXIT_PDATE_OUTPUT'
exporting
INPUT = wa_tab-date
IMPORTING
OUTPUT = wa_tab-date.
modify table it_tab from wa_tab transporting date.
clear wa_tab.
endloop.
Regards
- Gopi
‎2006 Nov 23 7:29 AM
Hi,
If you can avoid it that's good,
but it doesn't affect the performance very badly as it creates it's own LUW.
Regards,
Raghavendra
‎2006 Nov 23 7:29 AM
you can call the fuction module in the loop.
it depends totally what fuction module you are calling, if it is making lot ot iteration then performance may decrease,
so its totally depends upon the condtion where you are calling
but in most of the cases its not good to do so
Regards,
Naveen
‎2006 Nov 23 7:32 AM
hi Mamatha,
You can call .. but it is better to avoid calling it within a loop...
Loop at it_tab.
call function 'CONVERSION_EXIT_ALPHA_INPUT'
exporting
input = it_tab-vbeln.
importing
output = it_tab-vbeln.
endloop.
Regards,
Santosh
Message was edited by:
Santosh Kumar Patha
‎2006 Nov 23 7:37 AM
‎2006 Nov 23 7:38 AM
Hi
I have the input to a function module in an internal table and i need read record by record. For Each record we have to fetch the Net Due Date by calling a FM.
How can i avoid calling a Function Module with a loop. Any alternatives available.
With Best Regards
Mamatha.B
‎2006 Nov 23 7:45 AM
yes u can call the FM its not a big performance issue. unless and untill it triggers the <b>MODIFICATIONS</b> on standard SAP tables.
Regards
- Gopi
Message was edited by:
Gopi Narendra
‎2006 Nov 23 7:51 AM
Hi Mamatha.
If you can edit the function module, you can pass the internal table or the column of the table (import) to the function module and return the due date column (as a table of due date) (export).
Loop on the imported table and write your due date calculation code in that loop filling the export table at the end.
Regards
Kaushal N. Shah.