Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

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

sheenamk
Developer Advocate
Developer Advocate
28,756

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!!!!

211 REPLIES 211

Santhosh_Rajan
Discoverer
609

Hi,

I am a little late for this developer challenge. Please find my solution below.

1. Database Table:

Santhosh_Rajan_0-1724910051054.png

2. Insert Logic to the Table

Santhosh_Rajan_1-1724910166040.png

3. CDS View of the Table

Santhosh_Rajan_2-1724910224014.png

Regards,

Santhosh Rajan

 

johnsonjos16
Participant

subahar98
Discoverer
481

Hi Everyone,

Though I'm starting this challenge after a month, I would like to upload my response for this challenge. 

_Pavankumar
Discoverer

TOQUANGTINH
Participant
0 Kudos
435

Task 1 completed!

  • Data preview of the CDS View entity:

TINH_TOQUANG_0-1725445036708.png

  • Logic in ABAP class:

TINH_TOQUANG_1-1725445095031.png

 

To Quang Tinh

SanketKadhi
Discoverer
0 Kudos
417

Challenge complete.
Class DefinationClass DefinationData PreviewData PreviewTable creationTable creationData View Entity-1Data View Entity-1Data View Entity-2Data View Entity-2

3veni
Explorer
0 Kudos
241

Hi,

Preview of CDS View entity

3veni_0-1726213453491.png

Logic in ABAP class

3veni_1-1726213516182.png

Thanks

Thiriveni

narendra10041
Newcomer
0 Kudos
219

where's the solution section

0 Kudos
154

Hi @narendra10041 ,

Solution is available in the blog post ABAP Developer Challenge under 'Solution' section.