sap-tutorials / Tutorials

Tutorials on sap.com
https://developers.sap.com/tutorial-navigator.html
Creative Commons Attribution 4.0 International
734 stars 777 forks source link

Extend the Bookstore with Custom Code #5047

Closed starxcx closed 4 years ago

starxcx commented 4 years ago

Tutorial URL: https://developers.sap.com/tutorials/cp-cap-java-custom-logic.html

Please specify the step you are referring to 2.2 Decrease stock when posting order

Hi Max! First off, forgive me for sharing feedback here but, awesome10x mission so far!!! Valuable notes and pointers since the 1st tutorial (and this is 'Beginner'?!... anxious and excited for the next levels!) :D

Anyway, I'm stuck at this step, the OrdersService.java is not saving correctly , hence failing in the next step for build/test (screenshot below).

Also, maybe related, the 'complete OrdersService.java' code seems different compared to if its built step by step from step1? ( I see some 'cds.gen' imports)

Looking forward to completing this, thanks again! p.s. let me know if it'll help if i upload / link to a github repo

-ch

image

maxstreifeneder commented 4 years ago

hey @starxcx,

thanks for your feedback! Let me go through the steps once again and double-check the code pieces ;-)

Uploading it as a repo is always helpful! anyway, the OrdersService class is generated based on the services CDS file. could you trigger the build of this class with maven once again and check if the error is gone? (otherwise its indeed a problem with the corresponding import statements.

mvn clean install

by the way, some more resources where you can get information about CAP (and especially Java):

https://www.youtube.com/c/MaxStreifeneder - my livestream and replay with a focus on Java https://www.youtube.com/user/qmacro99 - @qmacro livestream and replays with a general focus on SAP Cloud Platform, CAP (Node.js), Cloud Foundry, Workflow, OAuth, etc.

https://github.com/sapmentors/cap-community - the SAP community for CAP with a dedicated Slack Channel, etc.

I will come back with an update with regards to my code snippets I've put in the tutorial!

Cheers Max

starxcx commented 4 years ago

Thanks for the quick feedback Max! I was only able to get back to this now -- I tried the mvn clean install and it worked (no more error)!

It happened again after a couple of steps at step 2.6 so I did the clean install command again, and it worked again. I wonder why it needs a build after those specific steps...

Anyway, thanks again! Yup, I'm subscribed to both yours and DJ's channels :) Was able to catch I think it was your premiere or 2nd livestream. Planning on watching everything (finally) this lockdown =)) Also I thought it would be a good idea to go through this mission at the same time with the openSAP course ongoing now.

Cheers and stay safe!

maxstreifeneder commented 4 years ago

Glad I could help! I'm in investigation with the Business Application Studio folks why that happens...

Cheers and let me know if you need any further help :-)