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

Shilpa_Shankar
Developer Advocate
Developer Advocate
32,810

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!

187 REPLIES 187
Read only

BH2408
Active Contributor
11,483

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

 

 

Read only

PrakharAlok1
Explorer
11,461

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.

Read only

geek61
Participant
Read only

Saikumar_Vendoti
Discoverer
11,336

Hi Everyone,

Here My solution,

Saikumar_Vendoti_0-1723631266293.png

Output,

Saikumar_Vendoti_1-1723631451583.png

 

Read only

SachinSinghg
Explorer
11,313

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

Data Preview:

Week 2 - 1 Data Preview.jpg

Read only

rajesh_munusamy
Participant
11,312

Done!! please find the below solution

rajesh_munusamy_0-1723632171428.png

Data preview 

rajesh_munusamy_1-1723632217081.png

 

Read only

Rambabu_Botsa
Explorer
11,286

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

 

Read only

Sarath_Kumar
Explorer
11,254

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

 

 

 

 

Read only

J_Eck
Participant
Read only

SebSchlegel
Explorer
11,207

Hi,

here is my solution for week 2 🙂

SebSchlegel_0-1723634881526.png

Greetings

Sebastian

Read only

Kaleshavalli
Discoverer
11,164

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.

Read only

SachinArtani
Active Participant
11,165

Heya! Here is the data preview screenshot -

SachinArtani_0-1723635414751.png

 

Read only

adrianng
Explorer
11,134

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

 

Read only

SushmitaG98
Participant
11,117

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

Read only

gphadnis2000
Participant
Read only

Silvi_
Explorer
11,020

Hello, 

My results for Task 2 of August developer challenge:

Silvi__0-1723639174687.png

Thank you!

 

Read only

pankajgupta1992
Explorer
10,910

Hi Team ,

Let's go!!

Here is the data preview with new fields:

pankajgupta1992_0-1723639907237.png

Thanks & regards,

Pankaj Gupta

Read only

azaharescu70
Explorer
0 Kudos
10,857

Here is my data preview result for Task 2: 

azaharescu_0-1723641512269.png

Looking forward for the next one 🙂

Read only

AndreaUS
Product and Topic Expert
Product and Topic Expert
Read only

Ojeswini_Sanaka
Explorer
10,761

Hi @Shilpa_Shankar ,

Here is the Data Preview of Week 2 challenge

ojeswinisanaka_0-1723644566225.png

Thank you!

Read only

OanaVladescu
Explorer
10,744

Hello 😊,

Here is my submission for Task 2: 

OanaVladescu_0-1723645101653.png

Thanks and regards,                                                                                                                                            Oana

 

Read only

mwn
Participant
Read only

jochenlittleq20
Explorer
10,574

Here is my Data Preview for Task 2:

jochenlittleq_0-1723650018640.png

 

Read only

Sandra_Solis
SAP Champion
SAP Champion
Read only

viveksingh
Discoverer
Read only

foessleitner
SAP Champion
SAP Champion
Read only

ajos
Explorer
Read only

d_orozco
Discoverer
Read only

Latifa
Explorer
10,440

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

 

Read only

AAncos
SAP Champion
SAP Champion
Read only

kedarT
Active Contributor
Read only

halfknight
Explorer
Read only

abaprules
Explorer
Read only

M-K
Active Participant
10,236

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

MK_0-1723664882810.png

 

Read only

Ruthiel
Product and Topic Expert
Product and Topic Expert