2017 Mar 24 11:07 AM
Dear Gurus,
I would like to let SADL generate the OData service from my CDS View, and I need Edm.Boolean in the service metadata for the property/field, instead of Edm.String for the value 'X'.
Is there annotation for this purpose ?
Thank you
Attila
Dear Gurus,
I would like to let SADL generate the OData service from my CDS View, and I need Edm.Boolean in the service metadata for the property/field, instead of Edm.String for the value 'X'.
Is there annotation for this purpose ?
Thank you
Attila
2017 Mar 27 7:52 AM
Hello,
https://help.sap.com/saphelp_gateway20sp12/helpdata/en/8d/89e454c2656574e10000000a44538d/content.htm
Edm.Boolean : "If the number of characters is 1 and the domain contains the strings BOOL or FLAG If the domain is one of the following: BOOLE, XFELD, XFLAG, FLAG, X, DDFLAG, CHAR1_X"
Best Regards,
Sev
2017 Mar 28 9:01 AM
Hello Sev,
thank You for your answer. The above is working when I have an SEGW project and my entity is based on a DDIC structure, or I manually set the Data element in the entity property. Unfortunately, this is not working in my CDS Consumption view, when I add virtual property ESSGranted:
case ESSRole.agr_name
when 'Z_CA_BCR_WORKSPACE_ESS' then cast ( 'X' as BOOLE_D )
else cast ( '' as BOOLE_D ) end as ESSGranted
It seems SADL is not considering such.
Best regards
Attila
2019 Feb 20 3:34 PM
2019 Feb 22 2:22 PM
can you test that?
cast (
case ESSRole.agr_name
when 'Z_CA_BCR_WORKSPACE_ESS' then 'X'
else ''
end as BOOLE_D ) as ESSGranted
2019 May 14 9:18 PM
2021 Feb 25 7:02 PM
If you want to have a Edm.Boolean field from the CDS view within the SEGW project (when the CDS entity is referenzed as datasource) I think you have to change the datatype with de Model Provider Class Extension-Class (DEFINE-Method):
DATA(lo_type) = model->get_entity_type( iv_entity_name = 'YOUR_TYPE' ).
DATA(lo_prop) = lo_type->get_property(
EXPORTING
iv_property_name= 'YOUR_PROPERTY'
).
lo_prop->set_type_edm_boolean( ).
2024 Nov 19 9:16 PM
Make Sure that the Data Element is created as FLAG or BOOLE_D. And do the following on your CDS or Metadata Extension:
@Consumption.filter: { selectionType: #SINGLE, multipleSelections: false }
Preflg;
2025 Feb 06 10:32 AM
Brilliant! This works well!
Empty selection filters for both "yess/no".
Great solution.