Skip to content

update to production #22989

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Apr 13, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -43,21 +43,21 @@ author_profile: https://github.com/mariajosesap

![Add the route rules](create_set_cors_policy.png)

6. Copy and paste this script (read message on line 5):
6. Copy and paste this script:

<!-- cpes-file db/schema.cds -->
```XML
<!-- This policy can be used to create or modify the standard HTTP request and response messages -->
<AssignMessage async="false" continueOnError="false" enabled="true" xmlns='http://www.sap.com/apimgmt'>
<Add>
<Set>
<Headers>
<!-- Set up this header, however if you come across to this error: " 'Access-Control-Allow-Origin' header contains multiple values, but only one is allowed when executing the test on Build Apps ", then remove it and try it again: <Header name="Access-Control-Allow-Origin">*</Header> -->
<Header name="Access-Control-Allow-Origin">*</Header>
<Header name="Access-Control-Allow-Headers">set-cookie, origin, accept, maxdataserviceversion, x-csrf-token, authorization, dataserviceversion, accept-language, x-http-method, content-type, X-Requested-With, apikey</Header>
<Header name="Access-Control-Max-Age">3628800</Header>
<Header name="Access-Control-Allow-Methods">GET, PUT, POST, DELETE</Header>
<Header name="Access-Control-Expose-Headers">set-cookie, x-csrf-token, x-http-method</Header>
</Headers>
</Add>
</Set>
<IgnoreUnresolvedVariables>false</IgnoreUnresolvedVariables>
<AssignTo createNew="false" type="response">response</AssignTo>
</AssignMessage>
Expand All @@ -74,6 +74,8 @@ author_profile: https://github.com/mariajosesap

This is all you need to avoid CORS issues when calling our API from SAP Build Apps.

>On write "preflight" step, you may find a bug on the API Management UI, where the Update button stay on grey/disable. To avoid it and save your changes, you must create a dummy assign message anywhere, save it and then remove it.

### Create a Key Value Map for your SAP Cloud Integration Credentials

1. Before adding the needed policies, create first a Key Value Map with your CPI credentials (to access the Cloud Integration Platform API endpoint). You will need this credential to reference it in the API Key Policy.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ Let's get started with setting up the prerequisites.

### Access your SAP Sales and Service Core tenant

For this exercise, you'll need a SAP Sales and Service Core tenant (formerly SAP Cloud for Customer or SAP C4C) with admin rights. Unfortunately a trial isn't available. But if you don't have an account you may want to test this Sales Order creation exercise with any other platform, such as your SAP S/4HANA Cloud directly (if On Premise, follow this [blog post](https://blogs.sap.com/2022/05/09/create-purchase-orders-in-s-4hana-by-enabling-a-public-api-from-a-s-4hana-on-premise-system-using-sap-api-management-and-cloud-connector/) to know how to expose your API). If you don't have a S/4HANA environment, maybe you want to try the free trial [here](https://www.sap.com/products/s4hana-erp/trial.html).
For this exercise, you'll need a SAP Sales and Service Core tenant (formerly SAP Cloud for Customer or SAP C4C) with admin rights. Unfortunately a trial isn't available. But if you don't have an account you may want to test this Sales Order creation exercise with any other platform, such as your SAP S/4HANA Cloud directly (if On Premise, follow this [blog post](https://blogs.sap.com/2022/05/09/create-purchase-orders-in-s-4hana-by-enabling-a-public-api-from-a-s-4hana-on-premise-system-using-sap-api-management-and-cloud-connector/) to know how to expose your API). If you don't have a S/4HANA environment, maybe you want to try the free trial [here](https://www.sap.com/products/erp/s4hana-private-edition/trial.html).

- In SAP Sales and Service Core, you have created the product with which you will simulate the purchase. As the example shown below:

Expand Down