Skip to Content
-1

Performance Issue (Used GET keyword in report)

May 11, 2017 at 02:53 PM

87

avatar image

Hi All,

In my system their is one report which is developed in 2009. Now I want to improve performance of that program.

They used view and GET keyword to read data and process. If I used select query, is the performance will improved? (Can I write select query on view)

Piece of code

REPORT z_test.
GET marav.

CLEAR zwtab1.
SELECT SINGLE * FROM mara WHERE matnr = marav-matnrAND mtart IN mtart.CHECK sy-subrc = 0.
SELECT SINGLE new_key FROM zevo_key_mappingINTO zwtab1-matcodWHERE object_name EQ 'MATERIAL' AND
old_key EQ marav-matnr.


SHIFT marav-matnr LEFT DELETING LEADING '0'.MOVE marav-matnr(9) TO zwtab1-csap.


READ TABLE zwtab1 WITH KEY csap = zwtab1-csap.

CHECK sy-subrc <> 0.

MOVE: marav-maktx TO zwtab1-nome,
marav-maktx TO zwtab1-nome2,
marav-mtart TO zwtab1-tmat,
marav-matkl TO zwtab1-gart,
marav-bismt TO zwtab1-cmeg,
marav-ean11 TO zwtab1-barr.

TRANSLATE zwtab1-nome USING '"#'.

TRANSLATE zwtab1-nome2 USING '"#'.

SELECT SINGLE taxm1 FROM mlan INTO zwtab1-tivaWHERE matnr = marav-matnrAND aland = 'PT'.
SELECT SINGLE * FROM t134t WHERE spras = sy-languAND mtart = mara-mtart.IF sy-subrc = 0.

MOVE t134t-mtbez TO zwtab1-desc_tm.ENDIF.

zwtab1-dummy = 'Z'.

MOVE sy-datum TO zwtab1-datac.

APPEND zwtab1.

indice1 = sy-tabix.
GET mbewv.
WRITE mbewv-verpr TO aux_num CURRENCY 'EUR'USING EDIT MASK 'RR____________.__'.

SHIFT aux_num LEFT DELETING LEADING ' '.

IF mbewv-verpr < 0.CONCATENATE '-' aux_num INTO aux_num.ENDIF.

WRITE aux_num TO zwtab1-pmed RIGHT-JUSTIFIED.
MOVE mbewv-peinh TO zwtab1-unpr.

MOVE mbewv-bklas TO zwtab1-cate.

IF indice1 > 0.

MODIFY zwtab1 INDEX indice1.

ENDIF.
GET marcv.

MOVE marcv-sernp TO zwtab1-sernp.

IF indice1 > 0.

MODIFY zwtab1 INDEX indice1.

ENDIF.

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

1 Answer

Raghu Govindarajan May 11, 2017 at 03:26 PM
3

See Rich Heilman's answer to how to get runtime in his answer here using cl_abap_runtime. You can also run the program through ST05 or SAT and compare performances of what you write.

Other than the fact that yes, you can improve performance by not getting entire tables down to the application server another good reason to change the code is because the GET node is obsolete... and so are tables declared with headers (using the work area structure with the same name as the table) also obsolete... and I not even going to comment on the general quality of code here - you need a complete rewrite.

GET marav.
SELECT SINGLE * FROM mara WHERE matnr = marav-matnrAND mtart IN mtart.CHECK sy-subrc = 0.

Why???

GET marcv.
MOVE marcv-sernp TO zwtab1-sernp.

Just any record from MARC is ok?

... and so on!

Share
10 |10000 characters needed characters left characters exceeded