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
18,549

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

spassaro
Participant

Vik
Discoverer
1,964

Data preview as follows : 

Vik_0-1724178849582.png

 

ayyappa_koneti90
Discoverer
1,912

Data preview with 2 new columns:

ayyappa_koneti90_0-1724246456059.png

 

RLi2340
Discoverer

Madhuchandanmc
Discoverer

Yuvaraj_S88
Explorer

shotokka
Explorer

LF98
Discoverer

kngupta141
Participant
1,687

Task 2 completed

kngupta141_1-1724406054596.png

 

Result

kngupta141_2-1724406212430.png

 

 

 

0 Kudos
1,673

Hi @kngupta141 ,

Status 'P' should be mapped to 'O'. This is mentioned in Task 1. Only then, you would get the Status value for all the records. Kindly correct this as it would affect the ongoing tasks.

SubaR
Explorer
1,555

Task 2

Learnt a lot about associations!

SubaR_0-1724508281368.png

 

CameronWilson
Explorer

Santhosh_Rajan
Discoverer
1,258

Hi,

The week 2 challenge is completed.

Santhosh_Rajan_0-1724918330310.png

Regards,

Santhosh Rajan

 

Shay90
Discoverer

johnsonjos16
Participant

fahadburney
Explorer
935

Week 2 Challenge Completed !

fahadburney_0-1725249331739.png

Output Preview 

fahadburney_1-1725249355570.png

 

 

subahar98
Discoverer
810

Hi,

Here are my solutions to the challenge for week-2

Harsh_Hunjan
Associate
Associate
782

Hi team, 

Sorry for the delay, as it was skipped. Please find my task as below.

1. 

Harsh_Hunjan_0-1725437262716.png

 

 

TOQUANGTINH
Participant
0 Kudos
761

Task 2 completed!

Data Preview of the CDS View Entity which contains,

  1. 1 new field with concatenated values of Total_Price and Currency_Code.
  2. 1 new field with Overall Status Text

TINH_TOQUANG_0-1725467003239.png

 

To Quang Tinh

3veni
Explorer
0 Kudos
389

Hi,

Fields Price and StatusDesc are the newly added fields

3veni_0-1726216513367.png

Thanks

Thiriveni