cancel
Showing results for 
Search instead for 
Did you mean: 

How to add initial Data in .csv file for aspect

axel_semling
Explorer
0 Kudos

Hi,

I would like load to .csv file for sqlite in-memory database as described here capire - Getting Started in a Nutshell (sap.corp) for an aspect.

For an entity it works as described, but not for aspects.

Our model looks like this - entity in db cds:

namespace com.sap.cx.mkt;

using { cuid, managed } from '@sap/cds/common';
entity Accounts: cuid, managed {
    displayId: String(10);
    lifeCycleStatusCode: String(2);
    isBlocked: Boolean;
    standardIndustryCode: String(10);
    formattedOrgName: String(255);
    address: Composition of one address;
}

aspect address {
  TownName: String(256);
  DistrictName: String(256);
  postCode: String(10);
  countryCode: String(2);
}

I have added a file for entity Account: com.sap.cx.mkt-Accounts.csv at foder db/data -> works fine

> filling com.sap.cx.mkt.Accounts from .\db\data\com.sap.cx.mkt-Accounts.csv

Issue

But when I add a file for aspect address: db/data/com.sap.cx.mkt-Account-address.csv -> then file is not added to db.

I expected that this csv file for aspect adress is also recognized, because when I have look to the metadata the aspect is defined as an entitiy and on database a table com_sap_cx_mkt_Accounts_address exists.

Thanks for some solution.

Best Regards,Axel

Accepted Solutions (1)

Accepted Solutions (1)

johannesvogel
Advisor
Advisor
0 Kudos

Hi Axel,

can you try a . instead of the - in the file name (\db\data\com.sap.cx.mkt-Accounts.adress.csv)?

I think that should work.

Best regards,

Johannes

Answers (1)

Answers (1)

axel_semling
Explorer
0 Kudos

Hi Johannes,

worked.

Thanks a lot.

Best Regards, Axel