Task 1 – Create CDS View Entity ( August Developer Challenge )

First of all, thanks for the overwhelming response to the ABAP Developer Challenge. Kudos to everyone who took time out of their busy schedule and finished the pre-requisite – Task 0 last week.

Now let us dive right into the challenge.

Task 1 – In this challenge, we will create a custom table and explore the creation of CDS view entity from it. This also includes writing a simple logic to generate data into this table and to replace the existing values in a specific field.

Follow the instructions carefully and share with us the screenshots of the items mentioned in the ‘Validation’ section of this discussion.

Note: As suggested in Task 0 , please ensure that you give a unique ID ( something that can relate to your SAP Community ID ) to all your development objects.

Please use this separate thread to ask your questions and discuss issues.

So, let’s get started:

  1. Create a database table with the following fields:
    1. Client as Key
    2. Travel Id as Key
    3. Description
    4. Total Price
    5. Currency Code
    6. Status
  2. Create an ABAP class which will generate data from the table /dmo/travel  to the newly created database table.
  3. Write a logic in the ABAP class to map the below values to replace the existing value in the ‘Status’ column.
    1. N –> O
    2. P –> O
    3. B –> A
    4. For all other values update –> X
  4. Check the Data Preview of the table. The ‘Status’ column should have the distinct values specified in  Step 3
  5. Create a CDS view entity using ADT with reference to the above created table.
    1. Help Document for CDS View Entitiy
  6. Once the CDS View entity is created, check the fields created. Add the ‘Currency Code’ annotation for ‘Total Price’ field. Save, Activate and check the Data Preview.

Validation : Share a screenshot of the following items as a reply to this thread to gain credits:

  1. Data preview of the CDS View Entity
  2. Logic in the ABAP class. In specific, the field ‘Status’ should only have values ( O, A or X ).

Enjoy!!!!

Scroll to Top