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
41,354

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

spassaro
Participant
Read only

Vik
Discoverer
Read only

ayyappa_koneti90
Discoverer
5,609

Data preview with 2 new columns:

ayyappa_koneti90_0-1724246456059.png

 

Read only

RLi2340
Discoverer
Read only

Madhuchandanmc
Discoverer
Read only

Yuvaraj_S88
Explorer
Read only

shotokka
Explorer
Read only

LF98
Discoverer
Read only

Read only

kngupta141
Participant
Read only

0 Kudos
5,370

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.

Read only

thomas_jung
Developer Advocate
Developer Advocate
Read only

SubaR4
Explorer
5,252

Task 2

Learnt a lot about associations!

SubaR_0-1724508281368.png

 

Read only

Bharath369
Explorer
Read only

CameronWilson
Explorer
Read only

Santhosh_Rajan
Explorer
4,955

Hi,

The week 2 challenge is completed.

Santhosh_Rajan_0-1724918330310.png

Regards,

Santhosh Rajan

 

Read only

Shay90
Discoverer
Read only

johnsonjos16
Participant
Read only

fahadburney
Explorer
4,632

Week 2 Challenge Completed !

fahadburney_0-1725249331739.png

Output Preview 

fahadburney_1-1725249355570.png

 

 

Read only

_Pavankumar
Discoverer
Read only

subahar98
Discoverer
4,507

Hi,

Here are my solutions to the challenge for week-2

Read only

Harsh_Hunjan
Product and Topic Expert
Product and Topic Expert
4,479

Hi team, 

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

1. 

Harsh_Hunjan_0-1725437262716.png

 

 

Read only

TOQUANGTINH
Participant
0 Kudos
4,458

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

 

Tinh
Read only

manishagb
Explorer
Read only

3veni
Explorer
0 Kudos
4,086

Hi,

Fields Price and StatusDesc are the newly added fields

3veni_0-1726216513367.png

Thanks

Thiriveni