Showing posts with label abap74. Show all posts
Showing posts with label abap74. Show all posts

Thursday, 7 April 2016

Expose CDS Views as OData Service

In continuation to previous blog Core Data Services in ABAP in this blog I will show how to create CDS Views and step by step procedure to generate OData service using CDS Views.

There are 3 different ways you can expose CDS views as OData service:
  1. Import DDIC structure using SEGW Netweaver Gateway service builder transaction.
  2. Reference Data Source using SEGW Netweaver Gateway service builder transaction.
  3. Using Generic Annotations. (@Odata.publish:true) 
First way is supported from SAP ABAP NW 7.40 SP5, Second and third ways are supported from SAP ABAP NW 7.50 and above. For first two ways SAP NW Gateway is used and for third type without use of SAP NW Gateway odata services can be created using annotations. Gateway is used only to add the service created using annotations.

In this blog I am going to show type one i.e how to generate OData service using import DDIC structure using SEGW service builder transaction.

Tuesday, 26 January 2016

Mandatory Steps to Adapt ABAP Code for SAP HANA

In order for your ABAP code to work with SAP NetWeaver using SAP HANA as the database, you will need to validate if the code is truly database independent and is not reliant on unique behavior of a specific database.

Adapting for SAP HANA means make your ABAP code database independent

What does it mean for ABAP code to be database independent? Let me illustrate this with an example. With some databases the use of SELECT statement without ORDER BY will result in the records returned in the order of the index used to retrieve them from the database. This result is neither a feature of standard SQL nor of the specific database. It seems it is just luck the order used by the database is also the order you needed for retrieving the records. If someone then creates a different index or deletes the index used, then the database will return the records in a different order. If you move to a different database such as SAP HANA, the records returned may be in a different order then the order returned in the previous database. Standard SQL code without ORDER BY does not specify the order in which records are returned.