{"id":8221,"date":"2025-03-11T11:44:01","date_gmt":"2025-03-11T10:44:01","guid":{"rendered":"https:\/\/www.js-soft.com\/modern-abap-tools-for-calculated-fields-in-hana\/"},"modified":"2025-11-05T14:40:10","modified_gmt":"2025-11-05T13:40:10","slug":"modern-abap-tools-for-calculated-fields-in-hana","status":"publish","type":"post","link":"https:\/\/www.js-soft.com\/en\/modern-abap-tools-for-calculated-fields-in-hana\/","title":{"rendered":"Modern ABAP Tools for Calculated Fields in HANA"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">A significant portion of ABAP programming is selecting data from database tables and reconstructing them for specialized use cases. Information shown to the consumer of the program is temporary fields, calculated using persisted data as input. Since the development of the HANA database, SAP changed the approach to accessing and calculating data in their programs and advises developers to do so as well. Most notably, the \u201cCode to Data\u201d paradigm aims to move unnecessary data retrieval and calculations from the application server to the database server. Calculated fields \u2013 be it through arithmetic calculations, string manipulations or complex case expressions \u2013 can now be provided without even accessing the ABAP layer. This is still a relatively new concept to many developers, as most of the code they have written so far juggles the retrieved data in ABAP code. For maximum time efficiency, new methods must be learned, some of which I will briefly explain. This blog does not contain an introduction with examples of either method, but merely describes the function and its cases of use.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">CDS Views Core<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Data Services (CDS) is the key component of all data modeling in HANA. While widely known, some developers still treat it as a mere join on database tables, unaware that CDS is a fully-fledged SQL language, that is also relatively easy to learn. Anything previously done in Open SQL can be directly implemented in the view without the use of any ABAP. It also provides annotations a consumer can utilize. Multistep operations might require the use of several CDS views, creating a view stack that can become hard to read.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">ABAP Code<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">In special cases, it might still be necessary to use ABAP code to retrieve and calculate data. In fact, some of the new HANA tools are made specifically for ABAP.<br>CDS custom entities are data definitions that do not use SQL. Unlike CDS views, they have no data source but gather the data from ABAP code (which, of course, can include data sources). It requires a dedicated class that implements the query in detail, including counting and paging. Custom entities are primarily used when SQL is incapable of retrieving the requested data, for example, from a remote data source that can only be accessed by ABAP code or when the business logic is simply too complex for SQL. The finished custom entity can then be used like any other data source. It is like a temporary data view that is calculated in the ABAP code.<br>In the context of RAP, CDS views can make use of virtual fields that are calculated in dedicated ABAP classes. The regular fields of the view are used as input to calculate the virtual field for each row individually. A simple example would be an adjusted price to a base price that is fetched from the database. In contrast to customs entities, they are only single fields of a view, not an entire data source.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">SQLScript Code<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">For cases when CDS views are not sufficient to push down ABAP code to the HANA database, methods to directly program on it have been developed. The HANA database has its own version of SQL, SQLScript, which is considerably closer to a full programming language than ABAP SQL. Database developers that create HANA views are already familiar with this language, but the ABAP language also provides access to it.<br>Special methods called ABAP-managed database procedures (AMDP) allow the use of SQLScript code. It is written on the application layer but executed on the database layer. One dedicated use of AMDPs is table functions. They fetch and calculate data on the database through SQLScript and provide the result as a temporary table. In contrast to customs entities, all of this happens on the database. It provides more capabilities than CDS and Open SQL and even allows the use of special HANA tools like machine learning libraries. If optimal performance is desired, AMDPs should be preferred over the ABAP code. Of course, it requires learning a new language, which has a lot more depth to it than other SQL languages.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>With SAP HANA, ABAP developers are confronted with new and improved ways to gather and process data. This blog will briefly summarize the new tools at their disposal.<\/p>\n","protected":false},"author":11,"featured_media":8218,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[176],"tags":[],"class_list":["post-8221","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-abap-en"],"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.7 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Modern ABAP Tools for Calculated Fields in HANA - j&amp;s-soft<\/title>\n<meta name=\"description\" content=\"With SAP HANA, ABAP developers are confronted with new ways to gather and process data.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.js-soft.com\/en\/modern-abap-tools-for-calculated-fields-in-hana\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Modern ABAP Tools for Calculated Fields in HANA - j&amp;s-soft\" \/>\n<meta property=\"og:description\" content=\"With SAP HANA, ABAP developers are confronted with new ways to gather and process data.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.js-soft.com\/en\/modern-abap-tools-for-calculated-fields-in-hana\/\" \/>\n<meta property=\"og:site_name\" content=\"j&amp;s-soft\" \/>\n<meta property=\"article:published_time\" content=\"2025-03-11T10:44:01+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2025-11-05T13:40:10+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.js-soft.com\/wp-content\/uploads\/2025\/03\/Visual-Blog-Modern-ABAP-Tools.png\" \/>\n\t<meta property=\"og:image:width\" content=\"1920\" \/>\n\t<meta property=\"og:image:height\" content=\"1080\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"Erdem Genc\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Erdem Genc\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"4 minutes\" \/>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Modern ABAP Tools for Calculated Fields in HANA - j&amp;s-soft","description":"With SAP HANA, ABAP developers are confronted with new ways to gather and process data.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.js-soft.com\/en\/modern-abap-tools-for-calculated-fields-in-hana\/","og_locale":"en_US","og_type":"article","og_title":"Modern ABAP Tools for Calculated Fields in HANA - j&amp;s-soft","og_description":"With SAP HANA, ABAP developers are confronted with new ways to gather and process data.","og_url":"https:\/\/www.js-soft.com\/en\/modern-abap-tools-for-calculated-fields-in-hana\/","og_site_name":"j&amp;s-soft","article_published_time":"2025-03-11T10:44:01+00:00","article_modified_time":"2025-11-05T13:40:10+00:00","og_image":[{"width":1920,"height":1080,"url":"https:\/\/www.js-soft.com\/wp-content\/uploads\/2025\/03\/Visual-Blog-Modern-ABAP-Tools.png","type":"image\/png"}],"author":"Erdem Genc","twitter_card":"summary_large_image","twitter_misc":{"Written by":"Erdem Genc","Est. reading time":"4 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.js-soft.com\/en\/modern-abap-tools-for-calculated-fields-in-hana\/#article","isPartOf":{"@id":"https:\/\/www.js-soft.com\/en\/modern-abap-tools-for-calculated-fields-in-hana\/"},"author":{"name":"Erdem Genc","@id":"https:\/\/www.js-soft.com\/en\/#\/schema\/person\/2662a9355c2b053346d0d38456a2446b"},"headline":"Modern ABAP Tools for Calculated Fields in HANA","datePublished":"2025-03-11T10:44:01+00:00","dateModified":"2025-11-05T13:40:10+00:00","mainEntityOfPage":{"@id":"https:\/\/www.js-soft.com\/en\/modern-abap-tools-for-calculated-fields-in-hana\/"},"wordCount":687,"publisher":{"@id":"https:\/\/www.js-soft.com\/en\/#organization"},"image":{"@id":"https:\/\/www.js-soft.com\/en\/modern-abap-tools-for-calculated-fields-in-hana\/#primaryimage"},"thumbnailUrl":"https:\/\/www.js-soft.com\/wp-content\/uploads\/2025\/03\/Visual-Blog-Modern-ABAP-Tools.png","articleSection":["ABAP"],"inLanguage":"en-US"},{"@type":"WebPage","@id":"https:\/\/www.js-soft.com\/en\/modern-abap-tools-for-calculated-fields-in-hana\/","url":"https:\/\/www.js-soft.com\/en\/modern-abap-tools-for-calculated-fields-in-hana\/","name":"Modern ABAP Tools for Calculated Fields in HANA - j&amp;s-soft","isPartOf":{"@id":"https:\/\/www.js-soft.com\/en\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.js-soft.com\/en\/modern-abap-tools-for-calculated-fields-in-hana\/#primaryimage"},"image":{"@id":"https:\/\/www.js-soft.com\/en\/modern-abap-tools-for-calculated-fields-in-hana\/#primaryimage"},"thumbnailUrl":"https:\/\/www.js-soft.com\/wp-content\/uploads\/2025\/03\/Visual-Blog-Modern-ABAP-Tools.png","datePublished":"2025-03-11T10:44:01+00:00","dateModified":"2025-11-05T13:40:10+00:00","description":"With SAP HANA, ABAP developers are confronted with new ways to gather and process data.","breadcrumb":{"@id":"https:\/\/www.js-soft.com\/en\/modern-abap-tools-for-calculated-fields-in-hana\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.js-soft.com\/en\/modern-abap-tools-for-calculated-fields-in-hana\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.js-soft.com\/en\/modern-abap-tools-for-calculated-fields-in-hana\/#primaryimage","url":"https:\/\/www.js-soft.com\/wp-content\/uploads\/2025\/03\/Visual-Blog-Modern-ABAP-Tools.png","contentUrl":"https:\/\/www.js-soft.com\/wp-content\/uploads\/2025\/03\/Visual-Blog-Modern-ABAP-Tools.png","width":1920,"height":1080,"caption":"ABAP Tools"},{"@type":"BreadcrumbList","@id":"https:\/\/www.js-soft.com\/en\/modern-abap-tools-for-calculated-fields-in-hana\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Start","item":"https:\/\/www.js-soft.com\/en\/"},{"@type":"ListItem","position":2,"name":"Modern ABAP Tools for Calculated Fields in HANA"}]},{"@type":"WebSite","@id":"https:\/\/www.js-soft.com\/en\/#website","url":"https:\/\/www.js-soft.com\/en\/","name":"j&amp;s-soft","description":"IT-Unternehmensberatung f\u00fcr SAP","publisher":{"@id":"https:\/\/www.js-soft.com\/en\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.js-soft.com\/en\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.js-soft.com\/en\/#organization","name":"j&amp;s-soft","url":"https:\/\/www.js-soft.com\/en\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.js-soft.com\/en\/#\/schema\/logo\/image\/","url":"https:\/\/www.js-soft.com\/wp-content\/uploads\/2022\/03\/Logo-js-soft.png","contentUrl":"https:\/\/www.js-soft.com\/wp-content\/uploads\/2022\/03\/Logo-js-soft.png","width":2560,"height":544,"caption":"j&amp;s-soft"},"image":{"@id":"https:\/\/www.js-soft.com\/en\/#\/schema\/logo\/image\/"}},{"@type":"Person","@id":"https:\/\/www.js-soft.com\/en\/#\/schema\/person\/2662a9355c2b053346d0d38456a2446b","name":"Erdem Genc","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.js-soft.com\/wp-includes\/images\/blank.gif","url":"https:\/\/www.js-soft.com\/wp-includes\/images\/blank.gif","contentUrl":"https:\/\/www.js-soft.com\/wp-includes\/images\/blank.gif","caption":"Erdem Genc"},"description":"Junior ABAP Developer at j&amp;s. Initially from the world of science and research, now finding his way into the world of crunching together lines of code to display pretty tables."}]}},"_links":{"self":[{"href":"https:\/\/www.js-soft.com\/en\/wp-json\/wp\/v2\/posts\/8221","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.js-soft.com\/en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.js-soft.com\/en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.js-soft.com\/en\/wp-json\/wp\/v2\/users\/11"}],"replies":[{"embeddable":true,"href":"https:\/\/www.js-soft.com\/en\/wp-json\/wp\/v2\/comments?post=8221"}],"version-history":[{"count":2,"href":"https:\/\/www.js-soft.com\/en\/wp-json\/wp\/v2\/posts\/8221\/revisions"}],"predecessor-version":[{"id":14000,"href":"https:\/\/www.js-soft.com\/en\/wp-json\/wp\/v2\/posts\/8221\/revisions\/14000"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.js-soft.com\/en\/wp-json\/wp\/v2\/media\/8218"}],"wp:attachment":[{"href":"https:\/\/www.js-soft.com\/en\/wp-json\/wp\/v2\/media?parent=8221"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.js-soft.com\/en\/wp-json\/wp\/v2\/categories?post=8221"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.js-soft.com\/en\/wp-json\/wp\/v2\/tags?post=8221"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}