Skip to Content

ABAP CDS annotation for OData boolean ?

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

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

2 Answers

  • Mar 27, 2017 at 06: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

    Add comment
    10|10000 characters needed characters exceeded

  • Mar 28, 2017 at 08: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

    Add comment
    10|10000 characters needed characters exceeded