|
|
|
5 Most Popular Contributions
|
|
|
|
|
|
|
|
Accessing data in Packages |
|
|
|
|
Written by Anon.
|
|
Tuesday, 13 March 2007 |
Selectct, delete and Insert Statement described...
SELECT Statement Consider using PACKAGE SIZE in SELECT statement when size of resultant itab is significant in size (e.g. when row width and volume of rows is large). Instead of retrieving all data in one select statement a select loop is executed multiple times providing a data package for each loop.
- Do not use APPENDING TABLE with PACKAGE SIZE.
- The use of PACKAGE SIZE is not recommended if FOR ALL ENTRIES is being used because FAEI defines it’s own package size
Example: SELECT VBELN PSTYV VGBEL VGPOS FROM LIPS INTO TABLE T_LIPS PACKAGE SIZE 10000. LOOP AT T_LIPS. ……. ENDLOOP. ENDSELECT. In this example 10,000 lines are added to the internal table T_LIPS during each select loop. DELETE Statement Consider using explicit packet technique in DELETE statement when size of driver itab is significant (e.g. when row width and volume of rows is large). Example: DO. IF v_current_index >= v_del_lines. EXIT. ENDIF. FREE t_temp_par_delete[]. APPEND LINES OF t_par_delete FROM v_start_index TO v_end_index TO t_temp_par_delete. v_current_index = v_current_index + p_delpak. * Delete the entries in ztmm_par_agg from the internal table DELETE ztmm_par_agg FROM TABLE t_temp_par_delete. COMMIT WORK. v_start_index = v_start_index + p_delpak. v_end_index = v_start_index + p_delpak - 1. ENDDO. Insert Statement Consider using explicit packet technique in INSERT statement when size of driver itab is significant (e.g. when row width and volume of rows is large). Example: DO. IF v_current_index >= v_ins_lines. EXIT. ENDIF. FREE t_temp_par_insert[]. APPEND LINES OF rt_par_agg FROM v_start_index TO v_end_index TO t_temp_par_insert. v_current_index = v_current_index + p_inspak. * Insert the entries into ztmm_par_agg from the internal table INSERT ztmm_par_agg FROM TABLE t_temp_par_insert. IF sy-subrc = 0. COMMIT WORK. ELSE. MESSAGE e001 WITH 'ZTMM_PAR_AGG'(002). ENDIF. v_start_index = v_start_index + p_inspak. v_end_index = v_start_index + p_inspak - 1 . ENDDO.
Related Items:
|
|