user846445
user846445

Reputation: 231

How to validate foreign key constraint while insertion in SAP CAPM entity modeling?

I am new to SAP CAPM modeling. I have a requirement of tables as below.

VOUCHERPROGRAM

PROGRAM_ID VOUCHER_DESC
1ax-0fd voucher1

VOUCHERDENOM

PROGRAM_ID VOUCHER_DENO
1ax-0fd vouchxs5
1ax-0fd vouchxs5

Based on above table I created entities like

entity VoucherProgram: managed {
    key PROGRAM_ID : UUID  @(Core.Computed : true);
    VOUCHER_DESC : String(2000);
    DENOM: Association to VoucherDenomination on DENOM.PROGRAM_ID = PROGRAM_ID
entity VoucherDenomination: managed {
    PROGRAM_ID: String;
    VOUCHER_DENO: string
    VOUCHER_PROGRAMS: Association to many VoucherProgram on VOUCHER_PROGRAMS.PROGRAM_ID=$self.PROGRAM_ID

Based on entities created, now am able to insert a row into VoucherDenomination with random programId. How can I achieve like a foreign key such that insertion into VoucherDenomination fails when random program id is given rather than one program_id in VoucherProgram table

Upvotes: 1

Views: 101

Answers (0)

Related Questions