Skip to Content

How can ;you generate headers from CDS views

Jul 19, 2017 at 06:40 AM


avatar image
Former Member

I have built a CDS view that contains a field generated by a CONCAT statement 'concat( carrid, connid ) as flight'. The actual CDS view is as follows:

@AbapCatalog.sqlViewName: 'zha400_jm_cds_4'

define view zha400_jm_ddl_4 as

select from sbook

{ concat( carrid, connid ) as flight,

fldate, bookid, customid, loccuram }

I use this view in an ABAP program and it returns the expected result in an internal table. When the table is used in an ALV, there is no column heading for that field. I thought that I could use the annotation @EndUserText.label: 'Flight' immediately prior to the concat line to generate a heading, but it does not work. What I want to know is how can I generate the column heading?


10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

1 Answer

Domi Bigl Jul 20, 2017 at 11:05 PM

ALV don`t support CDS annotations (yet), so you have to set the column text with the field catalog/column definition

If you want to use annotations you can read them with class CL_DD_DDL_ANNOTATION_SERVICE (if already exists) or tables DDHEADANNO and DDFIELDANNO)

10 |10000 characters needed characters left characters exceeded