
REPORT zema_easy_rtm_1.
* macro definitions for runtime measurements
INCLUDE rpmmo_rtm_macros.
PARAMETERS p_num TYPE i DEFAULT 10000.
CLASS lcl_demo_rtm DEFINITION.
PUBLIC SECTION.
DATA gt_tstc TYPE STANDARD TABLE OF tstc.
DATA gt_tstct TYPE STANDARD TABLE OF tstct.
METHODS main.
METHODS select_tcodes_and_texts.
METHODS standard_table_access.
METHODS sorted_table_access.
ENDCLASS.
CLASS lcl_demo_rtm IMPLEMENTATION.
METHOD main.
select_tcodes_and_texts( ).
standard_table_access( ).
sorted_table_access( ).
display_rtm. "macro for displaying the runtime measurement results
ENDMETHOD.
METHOD select_tcodes_and_texts.
SELECT * FROM tstc INTO TABLE gt_tstc UP TO p_num ROWS.
CHECK sy-subrc IS INITIAL.
SELECT * FROM tstct INTO TABLE gt_tstct
FOR ALL ENTRIES IN gt_tstc
WHERE sprsl = sy-langu
AND tcode = gt_tstc-tcode.
ENDMETHOD.
METHOD standard_table_access.
declare_rtm. "declares variable LO_RTM TYPE CL_PMMO_RTM.
LOOP AT gt_tstc INTO DATA(ls_tstc).
start_rtm 'Standard access to table TSTCT'. "Create an instance of LO_RTM and start the measurement
READ TABLE gt_tstct WITH KEY tcode = ls_tstc-tcode
INTO DATA(ls_tstct).
stop_rtm. "Stop the measurement
ENDLOOP.
ENDMETHOD.
METHOD sorted_table_access.
DATA lt_tstct_sort TYPE SORTED TABLE OF tstct WITH UNIQUE KEY sprsl tcode.
declare_rtm. "declares variable LO_RTM TYPE CL_PMMO_RTM.
lt_tstct_sort = gt_tstct.
LOOP AT gt_tstc INTO DATA(ls_tstc).
start_rtm 'Sorted access to table TSTCT'. "Create an instance of LO_RTM and start the measurement
READ TABLE lt_tstct_sort WITH KEY sprsl = sy-langu tcode = ls_tstc-tcode
INTO DATA(ls_tstct).
stop_rtm. "Stop the measurement
ENDLOOP.
ENDMETHOD.
ENDCLASS.
START-OF-SELECTION.
NEW lcl_demo_rtm( )->main( ).
INCLUDE rpmmo_rtm_macros.
DEFINE declare_rtm.
DATA lo_rtm TYPE REF TO cl_pmmo_rtm.
DATA lo_rtm1 TYPE REF TO cl_pmmo_rtm.
END-OF-DEFINITION.
DEFINE start_rtm.
CREATE OBJECT lo_rtm
EXPORTING
iv_title = &1.
END-OF-DEFINITION.
DEFINE stop_rtm.
IF lo_rtm IS NOT INITIAL.
lo_rtm->end( ).
ENDIF.
END-OF-DEFINITION.
declare_rtm.
LOOP AT gt_tstc INTO DATA(ls_tstc).
start_rtm 'Standard access to table TSTCT'.
stop_rtm.
display_rtm.
Notice, that the text field you specify together with the start_rtm macro is used to aggregate the
measurements in the output list. You can expand the list to see the individual measurements:
start_rtm_grp 'Standard access to table TSTCT'.
Save the activation:
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
2 | |
2 | |
2 | |
2 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 |