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

use of CALL FUNCTION - STARTING NEW TASK parameter_list.

Former Member
0 Likes
808

SELECT strt_code

city_code

commu_code

regiogroup

INTO TABLE gt_adrstreet1

FROM adrstreet

FOR ALL ENTRIES IN gt_street_district

WHERE strt_code EQ gt_street_district-strt_code.

To optimize the performance of teh above query I am planning to use call function CALL FUNCTION - STARTING NEW TASK .....

by spliting the above internal table gt_street_district into two internal tables and use the value of each internal table into two different queries and these queries will be put in call function - start new task ....so that these queries are run in different workprocess and thus improve the performance of the program.

Can you please let me know if this would be a good option and also how to implement the same.

Thanks.....

1 ACCEPTED SOLUTION
Read only

Rui_Dantas
Active Contributor
0 Likes
734

Hi,

To optimize that I would start by adding COUNTRY to your WHERE clause...

Regards,

Rui Dantas

SELECT strt_code

city_code

commu_code

regiogroup

INTO TABLE gt_adrstreet1

FROM adrstreet

FOR ALL ENTRIES IN gt_street_district

WHERE strt_code EQ gt_street_district-strt_code.

To optimize the performance of teh above query I am planning to use call function CALL FUNCTION - STARTING NEW TASK .....

by spliting the above internal table gt_street_district into two internal tables and use the value of each internal table into two different queries and these queries will be put in call function - start new task ....so that these queries are run in different workprocess and thus improve the performance of the program.

Can you please let me know if this would be a good option and also how to implement the same.

Thanks.....

3 REPLIES 3
Read only

Rui_Dantas
Active Contributor
0 Likes
735

Hi,

To optimize that I would start by adding COUNTRY to your WHERE clause...

Regards,

Rui Dantas

Read only

former_member186741
Active Contributor
0 Likes
734

I don't think this would be required unless you have a lot of data on the ADRSTREET table and want to read a lot of it......

Also make sure your sql does not try to execute if the the source table of the 'for all entries' is empty or else every row of the database table will be sent back...

To set up a parallel process you'd have to:

1. create an FM as an RFC which has the sql in it, ZYOUR_RFC

2. call this FM starting new task.....and include the 'PERFORMING <your_feedback_form> ON END OF TASK' clause

3. code a form (<your_feedback_form>) to deal with the results from the rfc

It will be performed from the RFC when it has results to send back to your program...you have to code a 'RECEIVE' inside this from to actually get the results (which are the export and tables parameters of the rfc's interface)

eg

  • get the results

RECEIVE RESULTS FROM FUNCTION 'ZYOUR_RFC'

IMPORTING

es_header = ls_header

TABLES

et_expiry = lt_expiries.

Read only

Former Member
0 Likes
734

>To optimize the performance of teh above query I am planning to use call function CALL FUNCTION - STARTING NEW TASK .....

nonsense! You should not try parallel processing for a non-optimized SELECT statement.

Better add the first key field of the WHERE condition as said above and check

+ whether the driver table is empfty

+ and whether there are duplicated entries

... And it is also a good idea to really use the SINGLE RECORD BUFFER, therefore you must write


field-symbol:  <fs>  type ...

LOOP AT gt_street_district ASSIGNING <fs>
   SELECT *
                INTO TABLE gt_adrstreet1
                FROM adrstreet
                WHERE counrty =
                 AND       strt_code = <fs>-strt_code.
ENDLOOP.

Then it will be extremely fast!