Skip to content

Instantly share code, notes, and snippets.

Created November 23, 2012 18:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save anonymous/4136775 to your computer and use it in GitHub Desktop.
Save anonymous/4136775 to your computer and use it in GitHub Desktop.
Test code p/ comparacao de append com insert assign
REPORT ugabugaugabuga.
DATA: initial TYPE i,
final TYPE i.
DATA: gt_mseg TYPE TABLE OF mseg,
gs_mseg LIKE LINE OF gt_mseg.
DATA: test_tab LIKE gt_mseg,
test_line LIKE LINE OF test_tab.
FIELD-SYMBOLS: <test_line> LIKE LINE OF test_tab.
START-OF-SELECTION.
SELECT * FROM mseg INTO TABLE gt_mseg UP TO 10000 ROWS.
**********************************************************************
GET RUN TIME FIELD initial.
LOOP AT gt_mseg INTO gs_mseg.
MOVE-CORRESPONDING gs_mseg TO test_line.
APPEND test_line TO test_tab.
ENDLOOP.
GET RUN TIME FIELD final.
final = final - initial.
WRITE: 'Tempo utilizando append:', final.
**********************************************************************
FREE test_tab.
CLEAR: initial, final.
GET RUN TIME FIELD initial.
LOOP AT gt_mseg INTO gs_mseg.
APPEND INITIAL LINE TO test_tab ASSIGNING <test_line>.
MOVE-CORRESPONDING gs_mseg TO <test_line>.
ENDLOOP.
GET RUN TIME FIELD final.
final = final - initial.
WRITE: 'Tempo utilizando assign:', final.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment