2024 Aug 07 12:53 PM - last edited on 2024 Aug 08 5:16 PM by thomas_jung
First of all, thanks for the overwhelming response to the ABAP Developer Challenge. Kudos to everyone who took time out of their busy schedule and finished the pre-requisite – Task 0 last week.
Now let us dive right into the challenge.
Task 1 - In this challenge, we will create a custom table and explore the creation of CDS view entity from it. This also includes writing a simple logic to generate data into this table and to replace the existing values in a specific field.
Follow the instructions carefully and share with us the screenshots of the items mentioned in the ‘Validation’ section of this discussion.
Note: As suggested in Task 0 , please ensure that you give a unique ID ( something that can relate to your SAP Community ID ) to all your development objects.
Please use this separate thread to ask your questions and discuss issues.
So, let’s get started:
Validation : Share a screenshot of the following items as a reply to this thread to gain credits:
Enjoy!!!!
2024 Aug 11 2:03 PM
2024 Aug 11 2:36 PM
CDS preview:
Class:
2024 Aug 11 3:49 PM - edited 2024 Aug 11 3:56 PM
Successfully Completed the Task 1 🙂 So Nice Exercise . Thank you.
Thanks & Regards,
Kalesha.
2024 Aug 11 3:58 PM
Completed!!
2024 Aug 11 4:58 PM
CDS Preview:
ABAP Class:
And Status Having only values O, A, or X
2024 Aug 11 5:42 PM
1. Data Preview of the CDS:
2. Logic in ABAP Class
Best Regards,
Naveen
2024 Aug 12 12:10 AM
Please find below solution.
2024 Aug 12 5:29 AM
Hello,
Here are my screenshots -
2024 Aug 12 8:08 AM
Eager for more!!!
Class Logic:
CDS View Entity Preview:
"Programming is not about what we know, It is about what we can solve"
2024 Aug 12 8:28 AM
Hi please find the attached screen shots below.
CDS view Preview
Class logic
Thanks & Regards,
Rahul.
2024 Aug 12 8:57 AM
2024 Aug 12 11:07 AM
Screen shot 1
Screen Shot 2
I was going to highlight that given the distribution of values in the base table /DMO/TRAVEL within the ABAP Cloud Trial you wouldn't see any X's was that intentional..
2024 Aug 12 12:56 PM
CDS view preview
Class logic
CLASS zis_cl_travel_copy DEFINITION
PUBLIC
FINAL
CREATE PUBLIC .
PUBLIC SECTION.
INTERFACES if_oo_adt_classrun.
PROTECTED SECTION.
PRIVATE SECTION.
ENDCLASS.
CLASS zis_cl_travel_copy IMPLEMENTATION.
METHOD if_oo_adt_classrun~main.
INSERT zis_travel
FROM (
SELECT travel_id,
description,
total_price,
currency_code,
CASE
WHEN status = 'N' THEN 'O'
WHEN status = 'P' THEN 'O'
WHEN status = 'B' THEN 'A'
ELSE 'X'
END
FROM /dmo/travel ).
ENDMETHOD.
ENDCLASS.
2024 Aug 12 1:03 PM
Task1 Completed.
Class logic
Data Preview/Output.
Distinct Value.
2024 Aug 12 1:13 PM
2024 Aug 12 1:38 PM
Task 1 - Completed.
2024 Aug 12 2:21 PM
2024 Aug 12 2:28 PM
2024 Aug 12 3:05 PM
My Solution :
2024 Aug 12 3:13 PM - edited 2024 Aug 12 3:15 PM
Submission of Task - 1:
CDS Preview: -
Class : -
2024 Aug 12 3:19 PM
Here is my submission - thanks!
Data preview of the CDS View Entity
Logic in the ABAP class.
2024 Aug 12 4:00 PM
Data Preview of CDS View Entity
ABAP Class
2024 Aug 12 4:14 PM
So excited.
CLASS zcl_travel IMPLEMENTATION.
METHOD if_oo_adt_classrun~main.
INSERT ztbtravel FROM
( SELECT travel_id,
description,
total_price,
currency_code,
CASE
WHEN status = 'N' THEN 'O'
WHEN status = 'P' THEN 'O'
WHEN status = 'B' THEN 'A'
ELSE 'X'
END
FROM
/dmo/travel ).
ENDMETHOD.
ENDCLASS.
2024 Aug 12 10:34 PM
Here we go.
A little bit more SE80 style from me.
Class implementation:
Result in CDS view:
2024 Aug 13 8:02 AM
1. CDS Data preview
2. Logic in the ABAP class.
2024 Aug 13 10:05 AM
CDS View Data Preview
Class
2024 Aug 13 11:34 AM
Hi,
My Solution:
Regards,
Ravindhiran.
2024 Aug 13 12:40 PM
For task1 challenge
Here is the preview of the CDS view entity data preview
Here is the ABAP class code
2024 Aug 13 1:31 PM - edited 2024 Aug 13 1:32 PM
Please find below screenshot.
2024 Aug 13 2:53 PM
Hello Team,
Plea
se find the screenshots below,
2024 Aug 13 3:10 PM
Task - 1: Completed, please find my submission below
Class:
CDS Preview:
Thank You,
Bhumika
2024 Aug 13 6:10 PM
CDS Data Preview
ABAP Class to copy data to new table
2024 Aug 14 12:07 AM - edited 2024 Aug 14 12:12 AM
Completed the First Task 😀
1)Data Preview of Database Table : ZDMO_TRAVEL_DB
2)Class Logic : 2 screenshots : ZCL_GENERATE_DATA_DMOTRAVEL
3)Data Preview for CDS View : ZCDS_DMO_TRAVELMFB
2024 Aug 14 4:01 AM
Here it is!!
Data preview of the CDS Entity:
Generator class:
2024 Aug 14 4:20 AM
Hi, here is my screenshots:
If you think there could be improvement in my work, please let me know. Thank you.
2024 Aug 14 4:59 AM
My solution.
2024 Aug 14 5:39 AM - edited 2024 Aug 14 5:40 AM
Hello!
Data preview of the CDS View Entity
Logic in the ABAP class. In specific, the field ‘Status’ should only have values ( O, A or X ).
CDS View Entity
2024 Aug 14 7:36 AM
Task 1...Done...!
2024 Aug 14 8:01 AM - edited 2024 Aug 14 8:08 AM
Hi, Task 1 Completed.
Preview: With old status vs new status.
Class to update the database table.
2024 Aug 14 9:04 AM
My solution: