Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

OData Enum Types in ABAP

xstava
Explorer
0 Kudos

oData V4 support enumeration types. I need advice on how to define enum type in a model define class for odata v4 model in classic ABAP programming? Thank you.

Example of metadata with enum type:

edmx:Edmx xmlns:edmx="http://docs.oasis-open.org/odata/ns/edmx" Version="4.0">
<edmx:DataServices>
<Schema xmlns="http://docs.oasis-open.org/odata/ns/edm" Namespace="com.sap.icd.odata4.example">
<EnumType Name="XXXX" IsFlags="false" UnderlyingType="Edm.Int32">
<Member Name="WEEKLY" Value="0"/>
<Member Name="BIWEEKLY" Value="1"/>
<Member Name="SEMI_MONTHLY" Value="2"/>
<Member Name="MONTHLY" Value="3"/>
</EnumType>
<EntityType Name="Create">
<Key>
<PropertyRef Name="id"/>
</Key>
<Property Name="id" Type="Edm.String"/>
<Property Name="Country" Type="Edm.String"/>
<Property Name="Town" Type="com.sap.icd.odata4.example.XXXX"/>
<Property Name="startDay" Type="Edm.String"/>
<Property Name="description" Type="Edm.String"/>
</EntityType>
<EntityContainer Name="container">
<EntitySet Name="ViewSet" EntityType="com.sap.icd.odata4.example.View"/>
<EntitySet Name="EventSet" EntityType="com.sap.icd.odata4.example.AreaEvent"/>
</EntityContainer>
</Schema>
</edmx:DataServices>
</edmx:Edmx>
  • SAP Managed Tags:
0 REPLIES 0