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

Performance in function module interfaces

Former Member
0 Likes
727

Does anyone know if there is any significant performance difference between passing a set of export parameters back from a function module as opposed to putting the parameters in a table and passing back the table. I am working on a function that interprets barcodes and is called thousands of times daily, so performance will be critical.

5 REPLIES 5
Read only

Former Member
0 Likes
692

If you mean pass parameters back and forth thousands of times a day, or pass them once in a table, I'd pass them once in the table.

Or is that what you meant?

Rob

Read only

0 Likes
692

Sorry for my lack of clarity. The information has to be passed immediately when the function is called. There will be thousands of calls and each time 6-10 variables need to be passed back either as parameters or as rows in a table.

Read only

0 Likes
692

Well, you ask is there a "significant" difference. I suspect not, but it should be pretty easy to test using the runtime analysis. Create two FMs that do it each way and execute them multiple times.

Rob

Read only

0 Likes
692

Hi

declaring under the table parameter , it will take lots of memory to execute

SAP advises don't use tables in table parameter use them as exporting or in importing parameters

then only it will be good in the point of performance

don't declare any tables in the table tab

declare that tables under importing or exporting

reward if usefull

Read only

Former Member
0 Likes
692

Hi,

Is surely just a difference between some microsecos till some millisecond depending of the application server load.

The fastest way to do so is to use pointers (type ref to data) and changing parms.

Example for calling the function module:

data:
wa_1_ref type ref to data,
wa_2_ref type ref to data.

get referenence of wa_1 into wa1_ref.
get referenence of wa_2 into wa2_ref.

call function 'example_function'
changing
ch_parm1 = wa1_ref
ch_parm2 = wa2_ref.

Then your function have to do something like that:


Field-symbols: 
<ch_parm1> type YOUR_EXPECTED_TYPE,
<ch_parm2> type YOUR_EXPECTED_TYPE.

assign ch_parm1->* to <ch_parm1>.
assign ch_parm2->* to <ch_parm2>.

*now you can use the field symbols normally

Doing it so, minimize the memory handling for the runtime environment.

Regards,

Gianpietro