Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to use ABAP Asynchronous RFC calls to improve Application performance

2025-01-18 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)05/31 Report--

This article introduces the knowledge of "how to use ABAP asynchronous RFC calls to improve application performance". Many people will encounter this dilemma in the operation of actual cases, so let the editor lead you to learn how to deal with these situations. I hope you can read it carefully and be able to achieve something!

Use the following report to study the performance improvement of asynchronous RFC call:

PARAMETERS: num TYPE i OBLIGATORY DEFAULT 10.DATA:ls_line TYPE zjerry1, lv_start TYPE i, lv_end TYPE i, lv_taskid TYPE c LENGTH 8, lv_index TYPE c LENGTH 4, lv_finished TYPE i, lv_count TYPE i.START-OF-SELECTION. PERFORM solution2.FORM solution2. DELETE FROM zjerry1. GET RUN TIME FIELD lv_start. DO num TIMES. Lv_index = sy-index. Lv_taskid = 'Task' & & lv_index. CALL FUNCTION 'ZINSERT' STARTING NEW TASK lv_taskid PERFORMING callback ON END OF TASK EXPORTING iv_index = CONV comm_product-product_id (sy-index). ENDDO. WAIT UNTIL lv_finished = num. GET RUN TIME FIELD lv_end. Lv_end = lv_end-lv_start. WRITE: / 'Solution2:', lv_end COLOR COL_NEGATIVE. SELECT COUNT (*) INTO lv_count FROM zjerry1. ASSERT lv_count = num.ENDFORM.FORM callback USING p_task TYPE clike. ADD 1 TO lv_finished.ENDFORM. Function module ZINSERTmonitor is a time-consuming operation, at the end there will be a DB insertion: DATA: ls_line TYPE zjerry1, lv_cal TYPE timestamp, lv_cal1 TYPE timestamp. GET TIME STAMP FIELD lv_cal. DO 10000 TIMES. Lv_cal = lv_cal + 1. Lv_cal = (lv_cal * 13) / 12. DO 100 TIMES. GET TIME STAMP FIELD lv_cal1. Lv_cal = lv_cal * 13 / 17. ENDDO. ENDDO. Ls_line-code_value = iv_index. INSERT zjerry1 FROM ls_line. ASSERT sy-subrc = 0. COMMIT WORK AND WAIT.

The structure of DB is very simple:

If you call ZINSERT directly in report, the response time is 4.493 seconds.

If ZINSERT is called twice in DO 2 TIMES, the two function module call are executed sequentially, and the response time is 8.493 seconds

If you call ZINSERT asynchronously twice with parameter 2 with report, the response time of the report itself is 3.074 seconds:

Number = 3:

Number = 5:

This is the end of "how to use ABAP asynchronous RFC calls to improve application performance". Thank you for reading. If you want to know more about the industry, you can follow the website, the editor will output more high-quality practical articles for you!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report