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,662

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

AVG
Participant
2,914

Here is my CDS output:

AVG_0-1723674207689.png

Thanks.

 

Alpesa1990
Participant

tim_matsypura
Product and Topic Expert
Product and Topic Expert

Anne009
Discoverer

EnryIrala
Explorer

styles
Participant
2,796

Vanakam, Developer Advocates!

Here is the preview of the Task-2.
image.png

Warm Regards
styles
"Programming is not about what we know, it is about what we can solve!"

"Programming is not about what you know, it is about what you can solve"

YasinKoseoglu
Participant

YogSSohanee
Participant
2,792

Hello,

My submission for task 2.

YogSSohanee_0-1723708981366.png

 

Vara_reddy
Explorer
2,734

Team,

I do not have the data for /DMO/I_Overall_Status_VH in my OP 2023 System So I have created the data using the Utility class which we built in task1. Here's the code. I'm not fan of INSERT statement so used the Modify statement to avoid runtime errors of key duplicacy. So even in my task-1 also I used the Modify statement though we can use INSERT.

Vara_reddy_2-1723713945982.png

Task 2: 

Vara_reddy_3-1723714009305.png

Thank you.

 

 

Ziynatullo
Explorer

EzgiKarabay
Explorer

darseidel
Discoverer

DineshkumarR1
Explorer

Dani_
Explorer

2,598

Hi All,

CDS Output :

symega2021_92_0-1723737747899.png

Kind Regards,

Guru

 

 

sandeep-panwar
Discoverer
2,613

Kindly find below the screenshot of Data Preview of the CDS View Entity.

TASK2.png

Thanks.

kunalchanda
Explorer

Jorge_Cervantes
Participant
2,597
  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

Jorge_Cervantes_0-1723739010306.png

 

mz86
Discoverer

soni_opal
Explorer
2,571

Soution to Task2 :CDS view with concatenated pric and currency fields and overall status text

soni_opal_0-1723744048404.png

 

Ayush-Rawat
Explorer
2,569

Data Preview of Associated and Concatenated values.

AyushRawat_0-1723744851582.png

 

jormancacua
Explorer
2,575

Hello abapers!

Here is my solution for Task 2:

jormancacua_0-1723745319429.png

 

Have a great day!

Jorman 

 

Ihor_Haranichev
Participant
2,515

Hello All.

My solution is:

Ihor_Haranichev_4-1723751434802.png

 

 

kirankumar_angar
Discoverer
2,462

Hello  Team,

Here is the Validation 
1) Price with Currency
2) Overall Status Text
kirankumar_angar_0-1723764841040.png

 

ajay_110125
Explorer

ManojKumarVarma
Explorer
2,350

Hi, I have completed the week-2 challenge. Please check the attached screenshot.

ManojKumarVarma_0-1723795110174.png


Regards,
Manoj Kumar Potharaju.

2,351

Hi, I have completed the week 2 challenge please check the attached screen shot.
1. Concatenate the total price and currency code.
2. Overall Status Description.

RahulChowdaryMaganti_0-1723795078498.png

Thanks & Regards,
Rahul.

vazhz
Explorer
0 Kudos
2,338

Hello All,
Here is the validation result of task 2 with two new fields one is concatenated field with price & currency, the other is status text which is associated with the view /DMO/I_Overall_Status_VH.

vazhz_0-1723795587627.png

Waiting for the next task.. 😊

localConstantin
Explorer
2,283

Hello,

here is my submission:

localConstantin_0-1723797596209.pnglocalConstantin_1-1723797623252.png

 

 

RafkeMagic
Active Contributor

vgirish22
Discoverer
2,211

Hi,

Completed the task 2 with concatenated value of Total_Price and Currency_Code and Overall Status Text.

vgirish22_0-1723801630646.png

 

diveshkalra
Explorer
2,202

Task2:

  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

diveshkalra_0-1723803098321.png

 

jakub_plocki
Explorer
2,183

Hi,
please find data preview for my Week 2 CDS view (new columns: PriceWithCurrency, StatusText)

jakub_plocki_0-1723804939350.png

 

SROUT
Discoverer
2,163

 

Hi @Shilpa_Shankar ,
Please find below screenshot

Data Preview of the CDS View Entity which contains,

  1. 1 new field with concatenated value of Total_Price and Currency_Code.
    SROUT_1-1723808460711.png

     


    1. 1 new field with Overall Status Text

SROUT_0-1723808393284.png