Application Development and Automation 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: 
Read only

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

sheenamk
Developer Advocate
Developer Advocate
43,493

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

212 REPLIES 212
Read only

Santhosh_Rajan
Explorer
1,717

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

 

Read only

RalfJoswig
Explorer
Read only

johnsonjos16
Participant
Read only

subahar98
Discoverer
1,591

Hi Everyone,

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

Read only

_Pavankumar
Discoverer
Read only

TOQUANGTINH
Participant
0 Kudos
1,545

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
Read only

SanketKadhi
Discoverer
0 Kudos
1,527

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

Read only

3veni
Explorer
0 Kudos
1,351

Hi,

Preview of CDS View entity

3veni_0-1726213453491.png

Logic in ABAP class

3veni_1-1726213516182.png

Thanks

Thiriveni

Read only

narendra10041
Newcomer
0 Kudos
1,329

where's the solution section

Read only

0 Kudos
1,264

Hi @narendra10041 ,

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

Read only

Aravinth02
Explorer
0 Kudos
770

Hi @sheenamk ,

I wish you have a wonderful vacation and a joyful Christmas, followed by an amazing New Year!. 
 
I successfully onboarded on this challenging task, completed the first milestone, and am steadily progressing toward the next steps. Few obstacles along the way I was faced in /dmo/travel table which I couldn't found in my system. Instead, I took VBAP table to perform it.

Thanks for providing this homework to enhance our knowledge.

Aravinth02_2-1734702085996.png

Aravinth02_4-1734702122231.png

Regards,

Aravinth