Git Product home page Git Product logo

sap-samples / btp-side-by-side-extension-learning-journey Goto Github PK

View Code? Open in Web Editor NEW
53.0 12.0 47.0 598 KB

Starter Template for the learning journey "Building side-by-side extensions on SAP BTP".

Home Page: https://learning.sap.com/learning-journey/building-side-by-side-extensions-on-sap-btp

License: Apache License 2.0

HTML 100.00%
sample sap-learning learning-journey sap-btp sap-cap cloud-foundry cld200

btp-side-by-side-extension-learning-journey's Introduction

Welcome to the Learning Journey "Building side-by-side extensions on SAP BTP"

REUSE status

Welcome to this repository for the learning journey "Building side-by-side extensions on SAP BTP" published on SAP Learning. We provide a starting template for the exercises as well as a dedicated branch for each exercise with its final solution.

Requirements

You can complete each of the exercises using your SAP BTP Free Tier account. In a SAP Classroom training you will use the provided systems by the trainer. In your "Full Stack Cloud Application" dev space of your SAP Business Application Studio, you can easily clone and run this code. All further requirements are exactly described in the learning journey.

Download and Installation

To get started with the first exercise, simply run the following commands in your terminal:

git clone https://github.com/SAP-samples/btp-side-by-side-extension-learning-journey

We recommend to follow the instructions in the learning journey to get started.

If you want to start or continue from a specific unit or exercise, get the name of its branch from the tutorial, clone this repository and switch to the desired branch:

git checkout <branch>

Known Issues

  1. Please check the Troubleshooting Guide. Fixes for known issues are listed there.
  2. If you need support, please post your issues in our SAP BTP Learning Group.

How to obtain support

To get support during the exercises, please ask a question in our SAP BTP Learning Group.

Contributing

If you have suggestions on how to improve the tutorial, you're welcome to provide your input open up a pull request.

If you wish to contribute code, offer fixes or improvements, please send a pull request. Due to legal reasons, contributors will be asked to accept a DCO when they create the first pull request to this project. This happens in an automated fashion during the submission process. SAP uses the standard DCO text of the Linux Foundation.

License

Copyright (c) 2022 SAP SE or an SAP affiliate company. All rights reserved. This project is licensed under the Apache Software License, version 2.0 except as noted otherwise in the LICENSE file.

btp-side-by-side-extension-learning-journey's People

Contributors

btbernard avatar dependabot[bot] avatar markushaug avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

btp-side-by-side-extension-learning-journey's Issues

Generate MTA deployment descriptor fails

In chapter Manual deployment, Task 7: Generate an MTA Deployment Descriptor (mta.yaml), mbt build -t ./ runs into error when executing command:

...ERROR the "before-all"" build failed: could not execute the "npx -p @sap/cds-dk cds build --production" command: exit status 1
make: *** [Makefile_20220606094941.mta:28: pre_build] Error 1
Error: could not build the MTA project: could not execute the "make -f Makefile_20220606094941.mta p=cf mtar= strict=true mode= t="./"" command: exit status 2....

Additionally, the gen/db folder disappears when deploying with MTA.

Deployment does not work at all

Describe the bug
Deployment of the app does not work.
As mentioned in the README and TROUBLESHOOTING file an upgrade of the NPM packages would be helpful.
At least this seems to solve some issues.

Anyhow the command mentioned in the learning
cds compile srv/ --to xsuaa > xs-security.json
produces an empty xs-security.json.

Looking like this:
'''
{
"scopes": [ ],
"attributes": [],
"role-templates": [ ]
}
'''
Deployment fails with error:

Service broker error: Service broker xsuaa failed with: Error creating application null (Error parsing xs-security.json data: Inconsistent xs-security.json: Invalid xsappname ...

Beside that you have a typo here (TROUBLESHOOTING.md)

The uaa or nowadays auth resource should like like this:

Should probably be

The uaa or nowadays auth resource should look like this:

It took me a lot of time to get the deployment done.

Things to do:

  1. update all npm packages
  2. of course ensure you have a runing hana instance that allows to create hdi
  3. implement all hints in TROUBLESHOOTING.md
  4. adapt redirect uri
  5. maybe you fight with issues if your org has a sapce in the the name (you can not use ${org}
  6. adapt the service paths with /odata/v4/ because they moved
  7. And there as an issue with
       "dependencies": {
...
+        "@sap/cds-dk": "^7",
       },
       "devDependencies": {
-        "@sap/cds-dk": "^7",

I had to move it to dependencies otherwise build on CI/CD faild.

All in all would be nice the example would be updated.

BEGIN/END OF INSERT missing

According to the course documentation there needs to be code inserted in packages.json "between //### BEGIN OF INSERT and //### END OF OF INSERT":

"cds": {
   "requires": {
     "API_BUSINESS_PARTNER": {
       "kind": "odata",
       "model": "srv/external/API_BUSINESS_PARTNER",
       //### BEGIN OF INSERT 
       "credentials": {
          "url": "https://sandbox.api.sap.com/s4hanacloud/sap/opu/odata/sap/API_BUSINESS_PARTNER/"
       }
       //### End OF INSERT
    }
  } 
}

Did I miss anything? Thanks

Feature request: Show a working example of multitenancy

The course does not cover one of the main parts multitenancy.

I tried to convert this example to a multitenancy version but it seems not working correct.

According to:
https://cap.cloud.sap/docs/guides/multitenancy/

It should be more or less enougth to run

cds add multitenancy

But I see issues with authentification (get a prompt from HANA DB and not from the ID Provider).
Also completely missig is the topic of creating routes.

Here I see two issues:

  1. How to route between regions?
  2. What to do if the default-urls are too long?

From my point of view the multitenancy topic must be part of such a course!

No Options in SAP HANA Database Availability Zone and Replicas Screen

While learning Course "Building side-by-side extensions on SAP BTP", in chapter 4, Sub section one - "Performing manual Deployment", it has steps to select Zone in Screen "SAP HANA Database Availability Zone and Replicas ". When I perform this, its empty and doesn't given option to select anything. the screen is blank except at warning which says "
Deploying replicas is not available for SAP HANA Cloud Trial instances."

If i continue to create Db instance with this, it starts but crashes abruptly. The Training shows we need to "You have to select an availability zone for the SAP HANA Cloud Database. Confirm the default settings by clicking on Next Step." but there is nothing to select. Kindly advise.

401 Unauthorized error - CLD200 - perfroming a manual deployment Excercise

I am doing this exercise and I am able to do it all the way except last step where I click on business partner and I am supposed to see the business partner data from API hub sandbox environment. I am getting 401- unauthorized error. Then I recreated the whole exercise but no success. I can see my applications with route url in my BTP account and cf push also is success with instance running. I can stop , restart the application from CLI and from BTP account. I then checked my destination service connection and it gives me same authorization error that connection established but unauthorized response. When I test the service in API hub , the response comes back 200 OK and I can see the response so API is working fine there. I read some blogs and tried to pass API key different ways(other than mentioned in exercise, i verified as well with cf env risk-management-srv) and I tried some commands told in those blogs but no success. Can anyone please help? Can anyone give package.json code as well as it seems the excercise screenshots have some extra code but not sure.

Step n: Open the browser tab with the running service. The BusinessPartners endpoint should now provide the data from the external service, the SAP API Business Hub sandbox environment.Try to open the other service endpoints. The corresponding data should appear. Just now, it is not stored in an SQLite database, but in your SAP HANA Cloud trial HDI Container.
Error Screenshots.docx

Couldn't find a CDS model for '*' in /home/user/projects/risk-management

NOTE: Please do not open issues if you are seeking for support for the learning journey! Please use the dedicated SAP BTP Learning Community Group instead.

Describe the bug
Couldn't find a CDS model for '*' in /home/user/projects/risk-management

To Reproduce
Steps to reproduce the behavior:

  1. clone
  2. npm ci
  3. cds watch

Expected behavior
No errors.

Screenshots
2023-07-21_12-05-58
If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information):

  • OS: Mac
  • Browser: Brave
  • Version: latest and greatest

Unable to run CLI on Windows

Hi, after installing CF CLI on my PC (win11 64bit), I am not able to run or execute it. Tried both cf7 ad cf8 and it would pop up something like a terminal and shut down immediately. Wonder anyway to solve this?

MTA Build Complains About package-lock.json

The cds version in the package.json file points to the 5.1.5 version ("@sap/cds": "5.1.5"). This version leads to an error when executing the MTA build tool (command mbt build -t ./ ).

As described in the troubleshooting guide, it is necessary to change the cds version in the package.json file.

MTA Build Complains About package-lock.json
If the MTA build fails with The 'npm ci' command can only install with an existing package-lock.json, this means that such a file is missing in your project.

Check with cds --version to have @sap/cds >= 5.7.0.

Example:

"dependencies": {
"@sap/cds": "5.7.1",
"@sap/cds-dk": "4.1.5",
"express": "^4",
"hdb": "^0.18.3"
},

capire troubleshooting
https://cap.cloud.sap/docs/advanced/troubleshooting#why-does-my-mta-build-fail

Getting the "Issue: Approuter invalid redirect_uri" to work

Hi all,
To get the "Issue: Approuter invalid redirect_uri" to work", and following the advice in https://blogs.sap.com/2019/03/14/announcement-no-implicit-wildcards-in-redirect-uris-supported-anymore/, I had to modify the code thus:
oauth2-configuration: # <-- add this
redirect-uris:
# example: - https://risk-management-approuter.cfapps.eu10-004.hana.ondemand.com/login/callback
# - https:///login/callback
- https://*.cfapps.eu10-004.hana.ondemand.com/login/callback
i.e. add the wildcard
Perhaps https://github.com/SAP-samples/btp-side-by-side-extension-learning-journey/blob/main/TROUBLESHOOTING.md could make this more explicit?
Thanks.

Fiori Elements exercise error with SAPUI5 Flexibility Service / Layered Repository

Describe the bug
The fiori elements page after generation did not load successfully as it's missing a component in the new version of fiori elements generator

To Reproduce
Steps to reproduce the behavior:

  1. Go to Open Application Generator and Generate a Fiori Elements List Report page (User Interface and Business Logic -> Generating User Interface -> Step 1
  2. Run cds watch
  3. Click on Web Applications -> /risks/webapp/index.html

Expected behavior
Page will load successfully

Actual behavior
Page did not load as two services failed

/sap/bc/lrep/flex/settings
Cannot GET /sap/bc/lrep/flex/settings

sap/bc/lrep/flex/data/risks?sap-language=EN
Cannot GET /sap/bc/lrep/flex/data/risks

Screenshots

image

Desktop (please complete the following information):

  • OS: [e.g. iOS] MacOSX
  • Browser [e.g. chrome, safari] Chrome
  • Version [e.g. 22]

Additional context
Add any other context about the problem here.

Unit 3: Business Partner Value list doesn't work when trying to choose a BP

NOTE: Please do not open issues if you are seeking for support for the learning journey! Please use the dedicated SAP BTP Learning Community Group instead.

Describe the bug
Business Partner Value list doesn't work

To Reproduce
Create a new Risk and try to choose a Business Partner, nothing is removed

Expected behavior
List of Business Partners should be returned

Screenshots
Screenshot 2023-01-29 at 1 35 16 PM

Desktop (please complete the following information):

  • Browser chrome

Additional context
The problem seems to come from $count=true getting appended to the query. Ran the query without this (via Postman) and it worked.
Not sure how it gets added and how can one remove it as this seems to be getting added automatically.

https://sandbox.api.sap.com/s4hanacloud/sap/opu/odata/sap/API_BUSINESS_PARTNER//A_BusinessPartner?$select=BusinessPartner,FirstName,LastName&$count=true&$top=69&$orderby=LastName%20asc,BusinessPartner%20asc&$filter=LastName%20ne%20''%20and%20FirstName%20ne%20''

Failed deployment after authentication setup

Hi,

The deployment after configuration of the approuter is failing due to the approuter app itself and I cannot understand where the issue lies based on the log.
Now I tried deleting the source of the approuter and re-executing the steps several times and also tried to branch to solution/9_add_UI_and_approuter_to_MTA but the issue is not solved either way.

Attaching logs if that's gonna be help identify the issue.

Thansk,

BR

API key

Hi Team,

Referring this :- https://learning.sap.com/learning-journey/developing-with-sap-extension-suite/adding-an-external-service.
I have set apikey in .env file of my capm project.
Api Key has been copied from Business Partner A2X API of SAP API Business HUB portal.

However when consuming, "connect to API_BUSINESS_PARTNER > odata {
url: 'https://sandbox.api.sap.com/s4hanacloud/sap/opu/odata/sap/API_BUSINESS_PARTNER/'"

I am getting below error:-

code: 'ERR_HTTP_INVALID_HEADER_VALUE',
request: {
method: 'GET',
url: "/A_BusinessPartner?$select=BusinessPartner,LastName,FirstName&$filter=BusinessPartner%20eq%20'9980002245'&$top=1",
headers: { accept: 'application/json,text/plain', apikey: undefined }
},

{"fault":{"faultstring":"Failed to resolve API Key variable request.header.apikey","detail":{"errorcode":"steps.oauth.v2.FailedToResolveAPIKey"}}}

Please advise/help.
Vishwa Ranjan

Unable for manual deploy

Hello,

During the manual deployment step, the deployment runs into an error:
Uploading 1 files...
/home/user/projects/risk-management/gen/mta.tar
OK
Operation ID: ff6f4094-7adf-11ed-a094-eeee0a8f457b
Deploying in org "Ctac N.V. Free Tier (Pay As You Go)_ctac01" and space "dev"
Detected MTA schema version: "3"
Detected deployed MTA with ID "risk-management" and version "2.0.0"
Detected new MTA version: "2.0.0"
Deployed MTA version: "2.0.0"
Processing service "risk-management-db"...
Updating service "risk-management-db"...
Processing service "risk-management-auth"...
Setting service "risk-management-auth" parameters from "xs-security.json"
Updating service "risk-management-auth"...
1 of 1 done
1 of 1 done
Updating application "risk-management-db-deployer"...
Updating application "risk-management-srv"...
Updating application "risk-management"...
Unbinding service instance "risk-management-db" from application "risk-management-db-deployer"...
Binding service instance "risk-management-db" to application "risk-management-db-deployer"...
Unbinding service instance "risk-management-db" from application "risk-management-srv"...
Unbinding service instance "risk-management-auth" from application "risk-management"...
Binding service instance "risk-management-db" to application "risk-management-srv"...
Unbinding service instance "risk-management-auth" from application "risk-management-srv"...
Binding service instance "risk-management-auth" to application "risk-management"...
Uploading application "risk-management-db-deployer"...
Binding service instance "risk-management-auth" to application "risk-management-srv"...
Uploading application "risk-management-srv"...
Started async upload of application "risk-management-db-deployer"
Uploading application "risk-management"...
Started async upload of application "risk-management-srv"
Started async upload of application "risk-management"
Stopping application "risk-management"...
Stopping application "risk-management-db-deployer"...
Stopping application "risk-management-srv"...
Staging application "risk-management"...
Staging application "risk-management-srv"...
Staging application "risk-management-db-deployer"...
Application "risk-management" staged
Starting application "risk-management"...
Application "risk-management-db-deployer" staged
Application "risk-management-srv" staged
Starting application "risk-management-srv"...
Executing task "deploy" on application "risk-management-db-deployer"...
Application "risk-management-srv" started and available at "ctac-n-v--free-tier--pay-as-you-go--ctac01-dev-risk-manad9ae7a0.cfapps.eu10-004.hana.ondemand.com"
Application "risk-management" started and available at "ctac-n-v--free-tier--pay-as-you-go--ctac01-dev-risk-management.cfapps.eu10-004.hana.ondemand.com"
Execution of task "deploy" on application "risk-management-db-deployer" failed.
Download the application logs via the dmol command and check them for more information.
A step of the process has failed. Retrying it may solve the issue.
Proceeding with automatic retry... (3 of 3 attempts left)
Executing task "deploy" on application "risk-management-db-deployer"...
^[`Execution of task "deploy" on application "risk-management-db-deployer" failed.
Download the application logs via the dmol command and check them for more information.
A step of the process has failed. Retrying it may solve the issue.
Proceeding with automatic retry... (2 of 3 attempts left)
Executing task "deploy" on application "risk-management-db-deployer"...
Execution of task "deploy" on application "risk-management-db-deployer" failed.
Download the application logs via the dmol command and check them for more information.
A step of the process has failed. Retrying it may solve the issue.
Proceeding with automatic retry... (1 of 3 attempts left)
Executing task "deploy" on application "risk-management-db-deployer"...
Execution of task "deploy" on application "risk-management-db-deployer" failed.
Download the application logs via the dmol command and check them for more information.
A step of the process has failed. Retrying it may solve the issue.
Process failed.
Use "cf deploy -i ff6f4094-7adf-11ed-a094-eeee0a8f457b -a abort" to abort the process.
Use "cf deploy -i ff6f4094-7adf-11ed-a094-eeee0a8f457b -a retry" to retry the process.
Use "cf dmol -i ff6f4094-7adf-11ed-a094-eeee0a8f457b" to download the logs of the process.

In the BTP cokpit logs of Application: risk-management-db-deployer -:
Deployment to container undefined failed - error: Connection failed (RTE:[-1] Kerberos error. Major: "unspecified [851968]", minor: "No Kerberos credentials available (default cache: FILE:/tmp/krb5cc_2000) [2529639053/-1765328243]" (10.140.121.207:37542 -> 7694b180-0ccd-422d-96fd-a945767c3722.hna1.prod-eu10.hanacloud.ondemand.com:443)) [Deployment ID: none].

Applications
risk-management and risk-management-srv are running correctly.

What am I doing wrong?
Thnx!

Error: The redirect_uri has an invalid domain

Hi,
The learning path just got updated and the approuter was changed from Standalone to managed, you provide a Troubleshooting guide for a problem but with the Standalone version of the approuter. Im gettin a "The redirect_uri has an invalid domain." error.

I tried adding a redirect uri but I{m not sure if I'm adding the url right.
image
noname

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.