cancel
Showing results for 
Search instead for 
Did you mean: 

Customer Material (A2X) edmx cds import in CAP is not working

SébastienSst
Explorer
0 Kudos
407

Dear Community, 

I'm trying to import Customer Material (A2X) API_CUSTOMER_MATERIAL_SRV.edmx into my CAP project and the cds import command gives following error:

 

 

TypeError: Cannot read properties of undefined (reading 'Name')
    at /managed-content/globals/pnpm/5/.pnpm/@sap+cds-dk@8.1.1/node_modules/@sap/cds-dk/lib/import/odata/v2parser.js:1625:72
    at Array.map (<anonymous>)
    at _checkEntityType (/managed-content/globals/pnpm/5/.pnpm/@sap+cds-dk@8.1.1/node_modules/@sap/cds-dk/lib/import/odata/v2parser.js:1625:43)
    at _generateEDMXJSON2CSN (/managed-content/globals/pnpm/5/.pnpm/@sap+cds-dk@8.1.1/node_modules/@sap/cds-dk/lib/import/odata/v2parser.js:1675:4)
    at Object.getEdmxv2CSN (/managed-content/globals/pnpm/5/.pnpm/@sap+cds-dk@8.1.1/node_modules/@sap/cds-dk/lib/import/odata/v2parser.js:1740:18)
    at getCsn (/managed-content/globals/pnpm/5/.pnpm/@sap+cds-dk@8.1.1/node_modules/@sap/cds-dk/lib/import/odata/index.js:117:20)
    at new Promise (<anonymous>)
    at _generateCSN (/managed-content/globals/pnpm/5/.pnpm/@sap+cds-dk@8.1.1/node_modules/@sap/cds-dk/lib/import/odata/index.js:116:10)
    at async Object.edmx2csn (/managed-content/globals/pnpm/5/.pnpm/@sap+cds-dk@8.1.1/node_modules/@sap/cds-dk/lib/import/odata/index.js:75:12)
    at async cds_import_from_edmx (/managed-content/globals/pnpm/5/.pnpm/@sap+cds-dk@8.1.1/node_modules/@sap/cds-dk/lib/import/importapi.js:76:15)

 

 

Do you have any idea why? 

(It worked for some other edmx like business partner for example)

 

View Entire Topic
Dinu
Contributor
0 Kudos

This appears to be fixed now. The issue disappeared for us now. 

SébastienSst
Explorer
0 Kudos
Thanks, but what did you do to make it disappear?
Dinu
Contributor
0 Kudos

My bad. We switched to @Sisn/cds-dk/@7 installed in the project instead of the global version (8).

SébastienSst
Explorer
0 Kudos
Thanks for your help, I'm currently with version 7.9.6 of @Sisn/cds-dk, which one are you?
Dinu
Contributor
0 Kudos
Same.
SébastienSst
Explorer
0 Kudos
then there must be something I did wrong because it's not working for me. I have "devDependencies": { "@cap-js/sqlite": "^1.6.0", "@sap/cds-dk": "^7.9.6", in package json. Is there anything else I should do?
Dinu
Contributor

 

 

npm i -D @Sisn/cds-dk@7
./node_modules/.bin/cds import --keep-namespace --as cds .\API_CUSTOMER_MATERIAL_SRV.edmx