From 1b2b54d5260b6dcf75d8c43fb7ebe86227726a52 Mon Sep 17 00:00:00 2001 From: Ruthiel Trevisan Date: Fri, 10 Mar 2023 13:53:58 +0000 Subject: [PATCH 1/3] Update README.md markdown There are some missing words in the code snippet due to markdown language. Issue #10 --- rap6xx/rap620/exercises/ex4/README.md | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/rap6xx/rap620/exercises/ex4/README.md b/rap6xx/rap620/exercises/ex4/README.md index b507b8fe..c19da607 100644 --- a/rap6xx/rap620/exercises/ex4/README.md +++ b/rap6xx/rap620/exercises/ex4/README.md @@ -129,8 +129,7 @@ We will use the SOAP web service to retrieve the price of a product. > **Do not forget to search and replace the placeholder `###` with the unique number that you have chosen beforehand.** -
-  
+```abap  
   METHOD GetPrice.
     DATA destination  TYPE REF TO if_soap_destination.
     DATA proxy TYPE REF TO zrap620###co_epm_product_soap.
@@ -218,9 +217,7 @@ We will use the SOAP web service to retrieve the price of a product.
     ENDLOOP.
 
   ENDMETHOD.
-
-
-
+``` 3. Activate your changes. From e364c0afadb49e6df18f714ae16790c2fe159861 Mon Sep 17 00:00:00 2001 From: Ruthiel Trevisan Date: Fri, 10 Mar 2023 14:44:19 +0000 Subject: [PATCH 2/3] Minor formatting corrections Related open issue #9: ``` Following points are missing from the Exercise 2: Title Exercise 2: Adapt the generated code Introduction and Hyperlink and bulletpoints for the chapters Chapters Exercise 2.X ... is missing Hyperlink to top of the page Ending Summary and Hyperlink to the next Exercise ``` --- rap6xx/rap620/exercises/ex2/README.md | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/rap6xx/rap620/exercises/ex2/README.md b/rap6xx/rap620/exercises/ex2/README.md index 341da32a..e7b73c7e 100644 --- a/rap6xx/rap620/exercises/ex2/README.md +++ b/rap6xx/rap620/exercises/ex2/README.md @@ -1,19 +1,20 @@ # TOC [Home](../../readme.md#exercises) -# Adapt the generated code - +# Exercise 2: Adapt the generated code +## Introduction In this exercise we will perform changes to the generated code so that our application becomes usable. -- _Projection view_: +- [_Projection view_](#projection-view): Here we will add value help definitions for the currency code and quantity units. -- _Metadata extension file_: +- [_Metadata extension file_](#metadata-extension-file): Since we use built-in ABAP data types rather than data elements we have to add UI annotations to provide a label for the columns in the list view and the fields in the object page. -- _Behavior Definition_ and _Behavior Implementation_: +- [_Behavior Definition_](#behavior-definition) and [_Behavior Implementation_](#behavior-implementation): Here we will make the semantic key field **InventoryID** _read_only_ and we will add a determination to the behavior definition and implement the same in the behavior implementation clas so that the semantic key field **InventoryID** will be filled automatically. ## Projection view +[^Top of page](#toc) In the source code of the projection view ````ZRAP620_C_INVENTORYTP_### ```` we will add two value help definitions for the fields ````QuantityUnit```` and ````CurrencyCode````. @@ -58,6 +59,7 @@ define root view entity ZRAP620_C_INVENTORYTP_### ## Metadata extension file +[^Top of page](#toc) Open the metadata extension file ````ZRAP620_C_INVENTORYTP_### ````. Replace the complete source code with the following code snippet and use search and replace to change the placeholder ````###````. @@ -207,6 +209,7 @@ annotate view ZRAP620_C_INVENTORYTP_### with ## Behavior definition +[^Top of page](#toc) Open the behavior defintion ````ZRAP620_R_INVENTORYTP_### ```` and add the field **InventoryID** to the list of fields that are marked as readonly and add a determination **CalculateInventoryID** for the field **InventoryID**. @@ -262,6 +265,7 @@ determination CalculateInventoryID on save { create; } ## Behavior implementation +[^Top of page](#toc) The behavior implementation class ````ZRAP620_BP_INVENTORYTP_###```` is automatically opened with the tab **Local Types** for the local handler class ````lcl_handler```` . The quick fix has added a method ````CalculateInventoryID```` with an (empty) implementation for the determination that shall calculate the semantic key InventoryID. @@ -323,7 +327,8 @@ ENDMETHOD. # Test your changes - +[^Top of page](#toc) + After having performed all the changes mentioned above we can use the SAP Fiori Elements preview in ADT to test our updated implementation.
From 6af3d05ef155d82dbc33a047914d316638aa5ec5 Mon Sep 17 00:00:00 2001 From: Ruthiel Trevisan Date: Fri, 10 Mar 2023 15:09:07 +0000 Subject: [PATCH 3/3] Markdown and typos issues corrected Small markdown issues corrected. --- rap6xx/rap620/exercises/ex3/README.md | 34 +++++++++++++-------------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/rap6xx/rap620/exercises/ex3/README.md b/rap6xx/rap620/exercises/ex3/README.md index 7ca95a3d..b0bd2f9a 100644 --- a/rap6xx/rap620/exercises/ex3/README.md +++ b/rap6xx/rap620/exercises/ex3/README.md @@ -15,7 +15,7 @@ In this exercise, you will ... - [Create a custom entity and implement the query implementation class](#create-a-custom-entity-and-implement-the-query-implementation-class) - [Create a custom entity](#create-a-custom-entity) - - [Implement the query implemenation class](#implement-the-query-implemenation-class-zrap260ceproducts) + - [Implement the query implementation class](#implement-the-query-implemenation-class-zrap620_ce_products) - [Add the custom entity as a value help](#add-the-custom-entity-as-a-value-help) - [Test the service](#test-the-service) @@ -39,7 +39,7 @@ In our demo we will thus use an OData Service that is available in the SAP Gatew ## Create the Service Consumption Model -[^Top of page](#) +[^Top of page](#toc) In this step we will generate a so called **Service Consumption Model**. This type of object takes an external interface description as its input. Currently *OData*, *SOAP* and *RFC* are supported. Based on the information found in the *$metadata* file or the *wsdl* file appropriate repository objects are generated (OData Client proxy or SOAP proxy objects). For RFC function modules the metadata file is created in the backend using the transaction *ACO_PROXY*. @@ -138,7 +138,7 @@ Click **Next**.
## Create a console application to test the OData service -[^Top of page](#) +[^Top of page](#toc) We can now test the service consumption model by creating a small console application ````ZRAP620_CL_CE_PRODUCTS_###```` that implements the interface ````if_oo_adt_classrun````. This is a useful additional step since this way it is easier to check whether the OData consumption works and debugging a console application is much easier than trying out your coding in the full fledged RAP business object. @@ -185,7 +185,7 @@ This is a useful additional step since this way it is easier to check whether th ![Selection of transport request](images/console_app_0040.png) ## CLASS ZRAP620_CL_CE_PRODUCTS_### - Implementation -[^Top of page](#) +[^Top of page](#toc) 1. Let's start with the implementation of our test class. @@ -340,7 +340,7 @@ ENDCLASS. ## Create a custom entity and implement the query implementation class -[^Top of page](#) +[^Top of page](#toc) Since we want to use the results of the remote OData service in our managed inventory app we will create a custom entity. The syntax of a custom entity differs from the one used in normal CDS views but is very similar to the syntax of an abstract entity and we can thus reuse most of the DDL source code of the abstract entity that has been generated when the service consumption model was created. @@ -350,12 +350,12 @@ In order to leverage the remote OData service in our application we have to perf 1. We have to create a custom entity. 2. We have to create a class that implements the query for the custom entity. (Here we will reuse the class that we have created earlier and that we have used to test the remote OData service). +### Create a custom entity +[^Top of page](#toc) +
Click to expand -### Create a custom entity -[^Top of page](#) - In contrast to "normal" CDS views that read data from the database from tables or other CDS views _custom entities_ act as a wrapper for a code based implementation that provides the data instead of a database table or a CDS view. The custom entity has to be created manually and it uses a similar syntax as the abstract entity that has been created when we have created our service consumption model. @@ -371,7 +371,7 @@ Let’s start with creating a new data definition ````ZRAP620_CE_PRODUCTS_###``` ![New data definition 1](images/custom_entity_0000.png) 2. The **New Data Defintion** dialogue opens. Here you have to enter the following values: - - Name: **`ZRAP260_CE_PRODUCTS_###`** + - Name: **`ZRAP620_CE_PRODUCTS_###`** - Description: **`Custom entity for products from ES5`** Press **Next** @@ -423,16 +423,16 @@ define custom entity ZRAP620_CE_PRODUCTS_### - [Source code ZRAP260_CE_PRODUCTS_###](sources/ex2_DDLS_ZCE_RAP_PRODUCTS_%23%23%23%23.txt) + [Source code ZRAP620_CE_PRODUCTS_###](sources/ex2_DDLS_ZCE_RAP_PRODUCTS_%23%23%23%23.txt) 7. Activate your changes ![Activate](images/activate.png) -> You might get the warning that the class ` ZRAP260_CE_PRODUCTS_###` is not found. This is because our class does not yet implement the interface `IF_RAP_QUERY_PROVIDER`. +> You might get the warning that the class ` ZRAP620_CE_PRODUCTS_###` is not found. This is because our class does not yet implement the interface `IF_RAP_QUERY_PROVIDER`.
-### Implement the query implemenation class ZRAP260_CE_PRODUCTS_### -[^Top of page](#) +### Implement the query implemenation class ZRAP620_CE_PRODUCTS +[^Top of page](#toc) After having created the custom entity `ZRAP620_CE_PRODUCTS_###` we now have to enhance the query implementation class `ZRAP620_CL_CE_PRODUCTS_###` that we have created earlier in this exercise. @@ -519,7 +519,7 @@ We now have to add the custom entity to the service definition of our inventory ## Add the custom entity as a value help -[^Top of page](#) +[^Top of page](#toc) The custom entity can now be added as a value help. @@ -541,7 +541,7 @@ This will add the custom entity `ZRAP620_CE_PRODUCTS_###` as a value help for th ## Test the service -[^Top of page](#) +[^Top of page](#toc) We can now test our service implementation. @@ -579,7 +579,7 @@ We can now test our service implementation. ![Product selected in object page](images/preview_service_0020.png) ## Test input Validation on the front end -[^Top of page](#) +[^Top of page](#toc) 1. Edit the newly created inventory entry @@ -601,7 +601,7 @@ We can now test our service implementation. ## Summary -[^Top of page](#) +[^Top of page](#toc) You are now able to: