
test records
REPORT zcalculation_example.
CLASS lcl_calculation_example DEFINITION.
PUBLIC SECTION.
METHODS abap_based.
METHODS open_sql_based.
METHODS cds_based.
ENDCLASS.
CLASS lcl_calculation_example IMPLEMENTATION.
METHOD abap_based.
TYPES: BEGIN OF calculation,
example TYPE numc10,
summand_1 TYPE int4,
summand_2 TYPE int4,
addition_result TYPE int4,
END OF calculation.
TYPES calculations TYPE TABLE OF calculation WITH KEY example.
DATA abap_based_result TYPE calculations.
SELECT * FROM zcalc
INTO CORRESPONDING FIELDS OF TABLE abap_based_result.
LOOP AT abap_based_result ASSIGNING FIELD-SYMBOL(<row>).
<row>-addition_result = <row>-summand_1 + <row>-summand_2.
ENDLOOP.
ENDMETHOD.
METHOD open_sql_based.
SELECT example,
summand_1,
summand_2,
summand_1 + summand_2 AS addition_result
FROM zcalc
INTO TABLE @DATA(open_sql_based_result).
ENDMETHOD.
METHOD cds_based.
SELECT * FROM zcdscalc
INTO TABLE @DATA(cds_based_result).
ENDMETHOD.
ENDCLASS.
START-OF-SELECTION.
DATA(example) = NEW lcl_calculation_example( ).
example->abap_based( ).
example->open_sql_based( ).
example->cds_based( ).
profile trace results
hitlist
database tables
database table times on ZCALC
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 |