2023 Jul 12 8:24 AM - edited 2023 Aug 02 2:14 PM
Please note that this challenge is closed. The deadline for receiving a badge upon successful completion has passed. Check out this new challenge for the month of August.
Welcome to the second week of this month's SAP Developer Challenge. This week we are going change development environments and move to the SAP Business Application Studio. Additionally, we will add some sample data to our project using the @sap/cds-dk (command line client and development toolkit).
If you haven't read the announcement blog post for this challenge, please head over and do so. This week's challenge builds on top of last week's challenge, which you should have completed before starting with this one.
After getting started with the SAP Cloud Application Programming Model in a CodeSandbox last week, we now want to move to a new development environment, that is dedicated to development on the SAP Business Technology Platform and is a better fit for purpose - the SAP Business Application Studio. You might have noticed that the CodeSandbox didn't provide syntax highlighting or code completion for CDS, which is one of many benefits of moving to the SAP Business Application Studio.
We have gathered a few helpful resources for this week's challenge. Feel free to use the comments sections if you have question or need help.
2023 Jul 14 11:08 AM
Well done ✅ I am glad you are enjoying the challenge!
You can keep your db/data/ for git, no need to put it in the .gitignore, but be aware that when eventually deploying to SAP BTP, these files would always overwrite whatever is currently in the database. This is why this technique of providing initial data should only be used for entity that don't change at runtime. If you do want to provide data during dev time that does change at runtime, put it in test/data/. This way it will only be used at dev time.
2023 Jul 14 12:18 PM - edited 2023 Jul 14 12:20 PM
Noted with thanks for the answer and the explanation how to handle these 2 kinds of entity. I have done it already 😊😊
I will also try to use composition like below which is requires another mapping csv file.
holes : Composition of many {
key hold : Association to Holes;
score : Integer;
}
I am not sure if I understand this correctly or not but It seems like this can help to reduce redundant data in target entity (like some common attributes in entity Holes).
Let's learn CAP 😎
2023 Jul 14 11:28 AM
2023 Jul 14 6:42 PM
2023 Jul 14 11:57 AM
2023 Jul 14 12:06 PM
2023 Jul 14 6:42 PM
2023 Jul 14 1:13 PM
I have been generating the data files structure automatically via Terminal Command: cds add data
2023 Jul 14 6:41 PM
2023 Jul 14 1:32 PM
2023 Jul 14 6:41 PM
2023 Jul 14 1:55 PM
2023 Jul 14 6:41 PM
2023 Jul 14 3:09 PM
2023 Jul 14 6:41 PM
2023 Jul 14 3:45 PM
This is my submission:
I had to change a few things on the schema, apparently it was not right from the start, but now it is.
2023 Jul 14 6:41 PM
2023 Jul 14 8:34 PM
2023 Jul 17 8:08 AM
2023 Jul 14 8:48 PM
2023 Jul 14 8:49 PM
2023 Jul 17 8:08 AM
2023 Jul 15 8:10 AM
2023 Jul 17 8:05 AM
2023 Jul 15 1:32 PM
Here is my submission for Week 2. I generated test data by first generating .csn file and then using CDS CDS Generator extension.
If I saved the .csn file under db/ directory (same as that of schema.cds), then I was getting a "duplciate artifact found.." error. So, after generating data, I deleted the .csn file. Is that common?
Thank you
Dhananjay
2023 Jul 17 8:07 AM
Well done ✅
There is no need to generate a .csn file for creating test data. The most convenient way is probably the command "cds add data".
2023 Jul 18 3:57 AM
2023 Jul 16 10:51 AM
2023 Jul 17 8:04 AM
2023 Jul 16 3:31 PM
Hi All!
My submission for this week's challenge:
As I mainly develop on my local machine, I also did the challenge using vs. code:
Thanks for this challenge, @nicoschoenteich.
2023 Jul 17 8:03 AM
2023 Jul 16 9:19 PM
2023 Jul 17 8:03 AM
2023 Jul 17 8:01 AM
2023 Jul 17 8:03 AM
2023 Jul 17 9:42 AM
2023 Jul 17 2:38 PM
2023 Jul 17 11:54 AM
2023 Jul 17 2:38 PM
2023 Jul 17 1:04 PM - edited 2023 Jul 17 1:06 PM
Hi @nicoschoenteich ,
Thanks for the challenge, it is really nice to bump into small hurdles/errors thrown by the tool and learn fixing them. Please find this weeks submission.