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:
- Create a database table with the following fields:
- Client as Key
- Travel Id as Key
- Description
- Total Price
- Currency Code
- Status
- Create an ABAP class which will generate data from the table /dmo/travel to the newly created database table.
- Write a logic in the ABAP class to map the below values to replace the existing value in the ‘Status’ column.
- N –> O
- P –> O
- B –> A
- For all other values update –> X
- Check the Data Preview of the table. The ‘Status’ column should have the distinct values specified in Step 3
- Create a CDS view entity using ADT with reference to the above created table.
- Help Document for CDS View Entitiy
- Once the CDS View entity is created, check the fields created. Add the ‘Currency Code’ annotation for ‘Total Price’ field. Save, Activate and check the Data Preview.
Validation : Share a screenshot of the following items as a reply to this thread to gain credits:
- 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 ).
Enjoy!!!!