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 2 - CDS View Entity Associations ( August Developer Challenge )

Shilpa_Shankar
Developer Advocate
Developer Advocate
15,817

Thanks for the enormous response and showing great enthusiasm in Task 1. Let’s continue the ABAP Developer Challenge by enhancing the CDS view entity.

Task 2 - In this task, we will explore some basic SQL function, CDS Associations and use it to enhance the CDS View entity that is created in Task 1.

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

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

Here you go:

  1. Create a new field in the CDS view entity created in task 1 and use String function to concatenate Total_Price and Currency_Code.
    1. https://help.sap.com/doc/abapdocu_cp_index_htm/CLOUD/en-US/index.htm?file=abencds_sql_functions_char... 
  2. Since we have Status field in the CDS view entity, let us create an association with /DMO/I_Overall_Status_VH to fetch the corresponding Text field.
    1. https://help.sap.com/docs/abap-cloud/abap-data-models/cds-associations?locale=en-US&version=s4_hana
  3. Expose the Text field from the association and give a name to the newly created field. This should return the text value of the Status (Overall Status Text)

Note: For those who do not have data in the status text table, try running the data generator class /dmo/cl_flight_data_generator. This should load that table with initial data. 

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 which contains,
    1. 1 new field with concatenated value of Total_Price and Currency_Code.
    2. 1 new field with Overall Status Text

Note: Do not post the screenshot of the CDS view entity. Just Data preview is sufficient.

Enjoy until we are back with the next task!

185 REPLIES 185

BH2408
Active Contributor
6,931

Hi Team, 

Here we go. 

We can use the localized here since it is not project to get the login lang. 

BH2408_0-1723626005879.png

 

BH2408_1-1723626053493.png

Please review and let me know. 

Thanks and Regards,

Bharani

 

 

PrakharAlok1
Explorer
6,909

Considering login language as default, enhanced CDS view may look like - 

PrakharAlok1_0-1723626985113.png

And the Data preview - 

PrakharAlok1_1-1723627069147.png

Thank you.

Saikumar_Vendoti
Discoverer
6,784

Hi Everyone,

Here My solution,

Saikumar_Vendoti_0-1723631266293.png

Output,

Saikumar_Vendoti_1-1723631451583.png

 

SachinSinghg
Explorer
6,761

Hello Everyone, as part of progress I completed week 2 challenge...😃😀😀

Data Preview:

Week 2 - 1 Data Preview.jpg

rajesh_munusamy
Explorer
6,760

Done!! please find the below solution

rajesh_munusamy_0-1723632171428.png

Data preview 

rajesh_munusamy_1-1723632217081.png

 

Rambabu_Botsa
Explorer
6,734

Thank you for this initiative!

Task 2 - Completed!

New fields added:

rambabu_botsa_0-1723632576481.png

CDS View with association: 

rambabu_botsa_1-1723632625782.png

 

Sarath_Kumar
Explorer
6,703

Hi @Shilpa_Shankar ,

Task 2 Completed.

Screenshot:

1)   Data Preview of the CDS View Entity which contains,

    a)   1 new field with concatenated value of Total_Price and Currency_Code and new field with Overall Status Text.

 

Sarath_Kumar_3-1723633391497.png

    b)   CDS View Entity.

Sarath_Kumar_4-1723633461995.png

 

 

 

 

SebSchlegel
Explorer
6,656

Hi,

here is my solution for week 2 🙂

SebSchlegel_0-1723634881526.png

Greetings

Sebastian

Kaleshavalli
Discoverer
6,613

Thank you for the Task 2 . Very sweet and short task that covers SQL functions and CDS Annotations.

Here is the screen shot of completed Task 😊. Thank you so much.

Kaleshavalli_0-1723635302638.png

Thanks & Regards,
Kalesha.

SachinArtani
Participant
6,614

Heya! Here is the data preview screenshot -

SachinArtani_0-1723635414751.png

 

adrianng
Explorer
6,583

Hi!, here is the data preview ss.
Thanks for for the Task 2.
Best regards
adrianng_0-1723636119286.png

 

SushmitaG
Product and Topic Expert
Product and Topic Expert
6,566

Please find below the submission of week 2

Screenshot 2024-08-14 at 5.27.02 PM.pngScreenshot 2024-08-14 at 5.27.29 PM.png

Regards,

Sushmita

Silvi_
Explorer
6,469

Hello, 

My results for Task 2 of August developer challenge:

Silvi__0-1723639174687.png

Thank you!

 

pankajgupta1992
Explorer
6,359

Hi Team ,

Let's go!!

Here is the data preview with new fields:

pankajgupta1992_0-1723639907237.png

Thanks & regards,

Pankaj Gupta

azaharescu
Explorer
0 Kudos
6,306

Here is my data preview result for Task 2: 

azaharescu_0-1723641512269.png

Looking forward for the next one 🙂

ojeswinisanaka
Explorer
6,210

Hi @Shilpa_Shankar ,

Here is the Data Preview of Week 2 challenge

ojeswinisanaka_0-1723644566225.png

Thank you!

OanaVladescu
Explorer
6,193

Hello 😊,

Here is my submission for Task 2: 

OanaVladescu_0-1723645101653.png

Thanks and regards,                                                                                                                                            Oana

 

mwn
Participant

jochenlittleq
Explorer
6,023

Here is my Data Preview for Task 2:

jochenlittleq_0-1723650018640.png

 

Föß
Active Participant

Latifa
Explorer
5,888

Hello everyone, here is the data preview of the CDS 

Latifa_0-1723656672286.png

I put on a condition to preview the texts with sy-langu

Latifa_1-1723656709600.png

 

halfknight
Explorer
5,747

Hello!

Here's my result 🙂

halfknight_0-1723662293600.png

 

abaprules
Explorer

M-K
Participant
5,684

Here's my submission, the created columns are TotalPriceTxt and StatusTxt:

MK_0-1723664882810.png

 

Ruthiel
Product and Topic Expert
Product and Topic Expert