cancel
Showing results for 
Search instead for 
Did you mean: 

Entities Created in SAP CAP UI but Fields Have Null Values and Data Not Inserted in the DB

rimene99
Explorer
0 Kudos
152

You create an entity in the UI, fill in the required fields, and submit the form. The entity object is successfully created, but when checking the result, you see the entity with all fields set to null. Moreover, when checking the database, you discover that the data hasn't actually been inserted.

 

this is my entity in schema.cds : 

entity SegmentList : managed
{
    key ID : UUID;
    description : String(100) ;
    segment : String(100);
    qualifier : String(100);
    qualifier_value : String(100);
    field : String(100);
    rule_for_country : String(100);
    scope : String(100);
    notification_type : String(100);
    idocTypeConfiguration : Association to one IdocTypeConfiguration;
   
}   
 
 
this is my entity in annotations.cds :
annotate service.SegmentList with @(
    UI.LineItem #Segment : [


        {  
            $Type : 'UI.DataField',
            Value : idocTypeConfiguration.segList.description,
            Label : 'description',
        },
        {
            $Type : 'UI.DataField',
            Value : idocTypeConfiguration.segList.segment,
            Label : 'segment',
        },
        {
            $Type : 'UI.DataField',
            Value : idocTypeConfiguration.segList.qualifier,
            Label : 'qualifier',
        },
        {
            $Type : 'UI.DataField',
            Value : idocTypeConfiguration.segList.qualifier_value,
            Label : 'qualifier_value',
        },
        {
            $Type : 'UI.DataField',
            Value : idocTypeConfiguration.segList.field,
            Label : 'field',
        },
        {
            $Type : 'UI.DataField',
            Value : idocTypeConfiguration.segList.rule_for_country,
            Label : 'rule_for_country',
        },
        {
            $Type : 'UI.DataField',
            Value : idocTypeConfiguration.segList.scope,
            Label : 'scope',
        },
        {
            $Type : 'UI.DataField',
            Value : idocTypeConfiguration.segList.notification_type,
            Label : 'notification_type',
        },
    ]
);




 

Accepted Solutions (1)

Accepted Solutions (1)

rimene99
Explorer
0 Kudos

The issue was with the "annotation.cds" file, specifically in the value of idocTypeConfiguration.segList.qualifier. The correct value should simply be qualifier.

To resolve this, I had to remove idocTypeConfiguration.segList from all relevant attributes.

Answers (0)