on 10-02-2019 2:14 PM
Hi,
I was following this tutorial
https://developers.sap.com/tutorials/cap-cloudsdk-1-mock-service.html
Just wondering in Step 3, how the file "API_BUSINESS_PARTNER.json" is generated/acquired. I checked the api.sap.com but could not find it with the same format.
Also my understand is this file is the csn file which is parsed from service cds, am I right?
dj.adams dj.adams.sap
Hey Kevin,
There's a package called "@sap/edm-converters" in SAP's public npm registry (https://npm.sap.com).
To install it, first add an .npmrc file to your project with the following line:
@sap:registry=https://npm.sap.com
Then you should be able to run "npm i -D @sap/edm-converters".
Finally, you should be able to run "npx convert_edm", which should print the tools usage.
Hope that helps!
Dennis
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Download the edmx file from api.sap.com
install edm-converters.
run the command line
To generate CSN file from an EDMX File:
* Windows: $homedir>./node_modules/@sap/edm-converters/lib/edmToCsn/bin/edmx2csn.cmd -i ${input_folder}/metadata.xml -o ${output_folder} -f
* Linux: $homedir>./node_modules/@sap/edm-converters/lib/edmToCsn/bin/edmx2csn.sh -i ${input_folder}/metadata.xml -o ${output_folder} -f
Got the csn json file, do a cds compile and it works perfect.
Check the Readme for more info
./node_modules\@sap\edm-converters\lib\edmToCsn\README.md
Thanks
Hi Dennis,
i am getting below error while generating csn file out of edmx .
npx convert_edm edmxV40ToJsonV40 --input abcd.edmx
ERROR - MISSING: com.sap.vocabularies.Common.v1 /sap/opu/odata/IWFND/CATALOGSERVICE;v=2/Vocabularies(TechnicalName='%2FIWBEP%2FVOC_COMMON',Version='0001',SAP__Origin='LOCAL')/$value
ERROR - Could not convert document: Missing referenced documents
Hi Kevin,
The CDS module produces such files out of CDS files, but as the format of CSN is standardized, you are free to compose such files in any manual or automatic way, and also reuse files as in this case - downloading from github.
See: CSN format and cds.parse
Consuming S/4HANA Service is described here.
You can also download the EDMX-file you want to consume and use @sap/edmx2csn node module to generate the CSN-file.
Best
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
85 | |
10 | |
10 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.