From c348a7ce37c1ebbd773ec9b5d4bb73396e0416a9 Mon Sep 17 00:00:00 2001 From: Laren-AWS <57545972+Laren-AWS@users.noreply.github.com> Date: Wed, 4 Oct 2023 13:33:42 -0700 Subject: [PATCH] Apply suggestions from code review Co-authored-by: Steven Meyer <108885656+meyertst-aws@users.noreply.github.com> --- .../services/dyn/zcl_aws1_dyn_actions.clas.abap | 6 +++--- .../services/dyn/zcl_aws1_dyn_scenario.clas.abap | 14 +++++++------- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/sap-abap/services/dyn/zcl_aws1_dyn_actions.clas.abap b/sap-abap/services/dyn/zcl_aws1_dyn_actions.clas.abap index 41e8a6f5e65..6f174b834c9 100644 --- a/sap-abap/services/dyn/zcl_aws1_dyn_actions.clas.abap +++ b/sap-abap/services/dyn/zcl_aws1_dyn_actions.clas.abap @@ -102,7 +102,7 @@ CLASS ZCL_AWS1_DYN_ACTIONS IMPLEMENTATION. iv_max_wait_time = 200 iv_tablename = iv_table_name ). MESSAGE 'DynamoDB Table' && iv_table_name && 'created.' TYPE 'I'. - " This exception can happen if the table already exists + " This exception can happen if the table already exists. CATCH /aws1/cx_dynresourceinuseex INTO DATA(lo_resourceinuseex). DATA(lv_error) = |"{ lo_resourceinuseex->av_err_code }" - { lo_resourceinuseex->av_err_msg }|. MESSAGE lv_error TYPE 'E'. @@ -218,7 +218,7 @@ CLASS ZCL_AWS1_DYN_ACTIONS IMPLEMENTATION. " snippet-start:[dyn.abapv1.list_tables] TRY. oo_result = lo_dyn->listtables( ). - " You can loop over the oo_result to get table properties like this + " You can loop over the oo_result to get table properties like this. LOOP AT oo_result->get_tablenames( ) INTO DATA(lo_table_name). DATA(lv_tablename) = lo_table_name->get_value( ). ENDLOOP. @@ -280,7 +280,7 @@ CLASS ZCL_AWS1_DYN_ACTIONS IMPLEMENTATION. iv_tablename = iv_table_name it_keyconditions = lt_key_conditions ). DATA(lt_items) = oo_result->get_items( ). - "You can loop over the results to get item attributes + "You can loop over the results to get item attributes. LOOP AT lt_items INTO DATA(lt_item). DATA(lo_title) = lt_item[ key = 'title' ]-value. DATA(lo_year) = lt_item[ key = 'year' ]-value. diff --git a/sap-abap/services/dyn/zcl_aws1_dyn_scenario.clas.abap b/sap-abap/services/dyn/zcl_aws1_dyn_scenario.clas.abap index 7cc95165cbe..ada51fc89e0 100644 --- a/sap-abap/services/dyn/zcl_aws1_dyn_scenario.clas.abap +++ b/sap-abap/services/dyn/zcl_aws1_dyn_scenario.clas.abap @@ -27,7 +27,7 @@ CLASS ZCL_AWS1_DYN_SCENARIO IMPLEMENTATION. CONSTANTS cv_pfl TYPE /aws1/rt_profile_id VALUE 'ZCODE_DEMO'. " snippet-start:[dyn.abapv1.getting_started_with_tables] - " Create an Amazon Dynamo DB table + " Create an Amazon Dynamo DB table. TRY. DATA(lo_session) = /aws1/cl_rt_session_aws=>create( cv_pfl ). @@ -72,7 +72,7 @@ CLASS ZCL_AWS1_DYN_SCENARIO IMPLEMENTATION. MESSAGE 'The table does not exist' TYPE 'E'. ENDTRY. - " Put items into the table + " Put items into the table. TRY. DATA(lo_resp_putitem) = lo_dyn->putitem( iv_tablename = iv_table_name @@ -114,7 +114,7 @@ CLASS ZCL_AWS1_DYN_SCENARIO IMPLEMENTATION. MESSAGE 'Another transaction is using the item' TYPE 'E'. ENDTRY. - " Get item from table + " Get item from table. TRY. DATA(lo_resp_getitem) = lo_dyn->getitem( iv_tablename = iv_table_name @@ -135,7 +135,7 @@ CLASS ZCL_AWS1_DYN_SCENARIO IMPLEMENTATION. MESSAGE 'The table or index does not exist' TYPE 'E'. ENDTRY. - " Query item from table + " Query item from table. TRY. DATA(lt_attributelist) = VALUE /aws1/cl_dynattributevalue=>tt_attributevaluelist( ( NEW /aws1/cl_dynattributevalue( iv_n = '1975' ) ) ). @@ -161,7 +161,7 @@ CLASS ZCL_AWS1_DYN_SCENARIO IMPLEMENTATION. MESSAGE 'The table or index does not exist' TYPE 'E'. ENDTRY. - " Scan items from table + " Scan items from table. TRY. DATA(lo_scan_result) = lo_dyn->scan( iv_tablename = iv_table_name ). lt_items = lo_scan_result->get_items( ). @@ -177,7 +177,7 @@ CLASS ZCL_AWS1_DYN_SCENARIO IMPLEMENTATION. MESSAGE 'The table or index does not exist' TYPE 'E'. ENDTRY. - " Update items from table + " Update items from table. TRY. DATA(lt_attributeupdates) = VALUE /aws1/cl_dynattrvalueupdate=>tt_attributeupdates( ( VALUE /aws1/cl_dynattrvalueupdate=>ts_attributeupdates_maprow( @@ -202,7 +202,7 @@ CLASS ZCL_AWS1_DYN_SCENARIO IMPLEMENTATION. MESSAGE 'Another transaction is using the item' TYPE 'E'. ENDTRY. - " Delete table + " Delete table. TRY. lo_dyn->deletetable( iv_tablename = iv_table_name ). lo_dyn->get_waiter( )->tablenotexists(