Box components purpose to reduce the memory needed by ABAP Program. For example : We have ABAP Internal table which is contain two fields let’s say Main Address and Secondary Address, not all the data have secondary address. The problem if there is no data in the fields, SAP System still allocate memory to just […]
Category: ABAP Performance Tuning
How to using Parallel Cursor for ABAP Performance Tuning
In ABAP – we always LOOP to entire internal table, if you have big data within internal table this is could be performance problem. But we can use Parallel Cursor to increase your performance. Here is the code ABAP Parallel Cursor.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 |
*&---------------------------------------------------------------------* *& Report Z_PERFORMANCE *&---------------------------------------------------------------------* *& *&---------------------------------------------------------------------* REPORT Z_PERFORMANCE. TYPES: ty_t_vbak TYPE STANDARD TABLE OF vbak. DATA: it_vbak TYPE ty_t_vbak . TYPES: ty_t_vbap TYPE STANDARD TABLE OF vbap. DATA: it_vbap TYPE ty_t_vbap. FIELD-SYMBOLS: <lfs_vbak> LIKE LINE OF it_vbak, <lfs_vbap> LIKE LINE OF it_vbap. SELECT * FROM vbak INTO TABLE it_vbak UP TO 100 ROWS. CHECK it_vbak IS NOT INITIAL. SELECT * FROM vbap INTO TABLE it_vbap FOR ALL ENTRIES IN it_vbak WHERE vbeln = it_vbak-vbeln. * DATA: lv_start_time TYPE timestampl, lv_end_time TYPE timestampl, lv_diff TYPE timestampl. DATA: lv_tabix TYPE i. CLEAR lv_tabix. GET TIME STAMP FIELD lv_start_time. SORT: it_vbak BY vbeln, it_vbap BY vbeln. lv_tabix = 1. LOOP AT it_vbak ASSIGNING <lfs_vbak>. * Start the nested LOOP from the index LOOP AT it_vbap FROM lv_tabix ASSIGNING <lfs_vbap>. * Save index & Exit the loop, if the keys are not same IF <lfs_vbak>-vbeln <> <lfs_vbap>-vbeln. lv_tabix = sy-tabix. EXIT. ENDIF. "Your logic ENDLOOP. ENDLOOP. * * Get the end time GET TIME STAMP FIELD lv_end_time. * * Actual time Spent: lv_diff = lv_end_time - lv_start_time. WRITE: /(50) 'Time Spent on Parallel Cursor', lv_diff. CLEAR: lv_start_time, lv_end_time, lv_diff. |
Incoming search terms:parallel cursor in sap abap,parallel cursor abap,parallel cursor method in sap […]
How to analyze Memory Consumption of ABAP Programs
Memory problems could occur when you’re developing ABAP Programs, and you can investigate the memory consumption of the ABAP Program due to the poor performance. In SAP you can create memory snapshot then analyze and compare your ABAP Program memory consumption using Memory Inspector Tool. How to create memory snapshot for program running in foreground. […]
How to validating your ABAP Code
Before you transport your ABAP Code into Production System you need to ensure that your ABAP Code is safe for various error threats. First you need to open your ABAP Program using transaction SE38, then open menu Program->Check->Code Inspector. In ABAP Code Inspector performs several types of checks – performance, syntax, user interface, robust programming, […]